This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA 7/8] Use unique_xmalloc_ptr in execute_gdb_command


>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:

Tom> Probably this should use __attribute__((warn_unused_result)), but that
Tom> isn't wrapped in ansidecl.h (yet) and I don't know offhand what version
Tom> test to use for it.  Do you?

Pedro> Good idea.  Looks like it's GCC 3.4.

This turns out not to work :(

FWIW in addition to the ATTRIBUTE_WARN_UNUSED_RESULT patch, I also had
to patch gdb's configure script to add -Wunused-result, as -Wunused
turns this off.

The g++ bug is known:

    https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38172

It looks like the accepted fix upstream to use the C++17 [[nodiscard]]
attribute; not sure if we can use that somehow.

Meanwhile I'm going to drop this part of my patch.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]