This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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: [PATCH] Fix 'array subscript is above array bounds' warning in res_send.c


When changing the source code does not actually cause any de-optimization
of the generated code, then it seems cleaner to change the code rather than
to suppress the warning.  In this case, changing the condition will change
what conditional-branch instruction is emitted, but it won't change the
number (or size) of instructions emitted or change anything that would
affect performance.  It doesn't matter a lot either way.  When the compiler
is being really dumb as appears to be the case here, then a substantial
comment about the compiler's stupidity is warranted; that makes it be even
less of a difference in cognitive load and source clutter between the code
change and the warning suppression.  But as to the general rule/policy,
changing the source code just to make the compiler happy is not the thing
we avoid: it's changes that de-optimize the generated code.


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