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++/70410] no uninitialized variable warning if 'offsetof' is used in expression


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
            ^
$

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