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/71188] missing warning converting constant integer expression zero to pointer


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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|missing warning converting  |missing warning converting
                   |__builtin_offsetof and      |constant integer expression
                   |sizeof to pointer           |zero to pointer

--- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> ---
This seems to be a general issue with all constant integer expressions that
evaluate to zero, such as enumerators, so changing the Summary to reflect that.

$ cat u.cpp && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S
-Wall -Wextra -Wpedantic -xc u.cpp
enum { e, f };
int *p = e;
int *q = f;
u.cpp:3:10: warning: initialization makes pointer from integer without a cast
[-Wint-conversion]
 int *q = f;
          ^

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