Software Quality Binutils
Nick Clifton
nickc@redhat.com
Tue Aug 14 11:19:00 GMT 2018
Hi John,
> But include/ansidecl.h
> has ATTRIBUTE_RETURNS_NONNULL, which static analysis tools could use
> (but so far as I'm aware, none do). Nevertheless, I think binutils
> could make more use of these gcc attributes than it currently does.
Agreed. And I will be happy to review any patches to add such attributes...
> Or "Remove this conditional structure or edit its code blocks so that
> they're not all the same". How on earth is that a bug ? It is not
> even bad coding.
>
> I think it's flagging things like:
>
> if (cond)
> {
> do_this ();
> do_that ();
> }
> else
> {
> do_this ();
> }
>
> ... which it wants changed to:
>
> do_this ();
> if (cond)
> do_that ();
>
>
> which of-course has the same effect iff evaluating cond does not
> have side effects.
True, but I do not see this as being a bug. A possible situation
for code quality improvement maybe, but not a bug.
Besides, how do I tell this scanner that actually the code sequence
is fine as it is and does not need to be changed ? I am not going
to change the code just to pacify a scanner. (I know that you said
the same thing - I am agreeing with you - so this comment is really
directed to Christoph).
Cheers
Nick
More information about the Binutils
mailing list