[Bug c/102867] [12 Regression] Waddress complaint in readelf.c

2021-10-21 Thread msebor at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102867

Martin Sebor  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |msebor at gcc dot 
gnu.org
 Status|NEW |ASSIGNED

--- Comment #4 from Martin Sebor  ---
The warning for macros was most likely inadvertently enabled in the change for
pr102103.  In hindsight, I'm guessing it's what triggered the instance in Glibc
(since fixed):
https://sourceware.org/pipermail/libc-alpha/2021-September/131241.html
and I think it might have also been what prompted the change below (I meant to
follow up there but got busy with other things):
https://gcc.gnu.org/pipermail/gcc-patches/2021-October/580786.html

I have a follow-on patch out for review for pr33925.  I'll look into the macro
suppression at the same time, although I'm not too keen on that idea in general
if it can be easily avoided in user code (e.g., inlining).  I'd rather get away
from it if it's not too painful.

The poor format of the expression in the warning is an independent issue worth
addressing separately.

[Bug c/102867] [12 Regression] Waddress complaint in readelf.c

2021-10-21 Thread amodra at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102867

--- Comment #3 from Alan Modra  ---
Not that I'm really complaining about this, note also that the error message
referencing "filedata->section_headers + (sizetype)((long unsigned int)i * 80)"
is a little bit too much of compiler internal representation leaking out. 
Nowhere in the source is such an expression used.  It's simply
"filedata->section_headers + i".

BTW, the warnings can be avoided by converting the readelf.c macros to inline
functions.

[Bug c/102867] [12 Regression] Waddress complaint in readelf.c

2021-10-21 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102867

Richard Biener  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
 Ever confirmed|0   |1
   Last reconfirmed||2021-10-21

--- Comment #2 from Richard Biener  ---
Confirmed.  I wonder if it is possible to omit the warning from chained
conditions that are from the same macro expansion.  That is, warn when
the macro is just

#define SECTION_NAME_VALID(X) ((X) != NULL)

but not when there's additional conditions on it.

[Bug c/102867] [12 Regression] Waddress complaint in readelf.c

2021-10-20 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102867

Andrew Pinski  changed:

   What|Removed |Added

Summary|Waddress complaint in   |[12 Regression] Waddress
   |readelf.c   |complaint in readelf.c
   Target Milestone|--- |12.0
   Keywords||diagnostic