This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70410] no uninitialized variable warning if 'offsetof' is used in expression
- From: "egallager at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 25 Aug 2017 00:04:48 +0000
- Subject: [Bug c++/70410] no uninitialized variable warning if 'offsetof' is used in expression
- Auto-submitted: auto-generated
- References: <bug-70410-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70410
Eric Gallager <egallager at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |RESOLVED
CC| |egallager at gcc dot gnu.org
Known to work| |8.0
Resolution|--- |WORKSFORME
--- Comment #1 from Eric Gallager <egallager at gcc dot gnu.org> ---
gcc8 warns for me:
$ /usr/local/bin/g++ -c -Wuninitialized 70410.cc
70410.cc: In function ‘int main()’:
70410.cc:12:12: warning: ‘a’ is used uninitialized in this function
[-Wuninitialized]
int b = a + offsetof(C, y); // <= missing warning that 'a' is uninitialized
^
$