This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC 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]

[Bug c++/44263] missing diagnostic on questionable array sizes with -pedantic


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=44263

Eric Gallager <egallager at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2017-09-26
                 CC|                            |egallager at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from Eric Gallager <egallager at gcc dot gnu.org> ---
I get a warning for g with -pedantic:

$ /usr/local/bin/g++ -c -Wall -Wextra -pedantic 44263.cc
44263.cc: In function ‘void foo()’:
44263.cc:12:39: warning: size of array is not an integral constant-expression
[-Wpedantic]
  char g[(char *) &((struct S *) 0)->b - (char *) 0];
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
$

But I'm assuming you're still requesting another warning for h? Confirmed in
that case.

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