[PATCH] MIPS/BFD: Correct/clean up ELF FP attribute warning messages

Richard Sandiford rdsandiford@googlemail.com
Mon Nov 19 12:17:00 GMT 2012


"Maciej W. Rozycki" <macro@codesourcery.com> writes:
> Hi,
>
>  While working on MIPS BFD ELF attribute code I have noticed that the 
> double- and single-float cases are swapped in warning messages -- the 
> former is denoted with "1" and the latter is denoted with "2" and the 
> messages interpret them in the opposite manner.  I guess that is an 
> unfortunate consequence of using magic numbers everywhere rather than 
> meaningful names and then a human error.  I have a follow-up change that 
> will correct this approach, however here is an independent essential 
> update to put the messages straight.
>
>  While working on this I have also noticed the messages are inconsistent 
> in that some report the name and the attribute of the output file first, 
> followed by the offending input file and its attribute, while the others 
> use the opposite order.  This only adds to the overall confusion, so I 
> have decided to take the opportunity and make the structure of all the 
> messages consistent, with the output file first -- this way the left-hand 
> side is going to stay the same across all the messages, if multiple are 
> produced.

Sorry to be a pain, but I don't think this part is a good change.
The current code is consistent in that it always uses the same error
message for the same incompatibility, whereas the changed code is
consistent in the order of the bfds.  From that point of view the
patch is trading one consistency for another.  But really, the fact
that we're using the output bfd at all is poor error reporting.
The real incompability is between two input objects, so ideally the
error message would be too.  (I've hit cases where the input bfd
had the ABI I wanted and it's taken me a while to figure out where
the "wrong" one came from.)  If that was fixed, I think we'd want
the current messages instead of the new ones.

As things stand, this patch doubles the number of error messages
that need to be translated.

A patch to fix the -msingle-float/-mdouble-float mixup without changing
the set of error strings is preapproved though.  Thanks for catching it.

Richard



More information about the Binutils mailing list