This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/71188] missing warning converting constant integer expression zero to pointer
- From: "msebor at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 19 May 2016 00:25:32 +0000
- Subject: [Bug c/71188] missing warning converting constant integer expression zero to pointer
- Auto-submitted: auto-generated
- References: <bug-71188-4 at http dot gcc dot gnu dot org/bugzilla/>
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;
^