Don't use bfd_get_* macro to set bfd fields

Tom Tromey tom@tromey.com
Wed Sep 18 15:19:00 GMT 2019
>>>>> "Alan" == Alan Modra <amodra@gmail.com> writes:

Alan> I've always thought it odd style to use a bfd_get macro on the left
Alan> hand side of an assignment.  I didn't think it worth bothering to
Alan> make a bfd_set variant for these as their use would be local to bfd.

One trick we use in gdb is to prevent these assignments by making the
macro expand to an rvalue.  An example from gdb:

#define MSYMBOL_SIZE(msymbol)		((msymbol)->size + 0)

Tom



More information about the Binutils mailing list