[Bug c++/70410] no uninitialized variable warning if 'offsetof' is used in expression

2018-03-21 Thread sergiusthebest at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70410

--- Comment #2 from Sergey Podobry  ---
It seems to fixed since gcc6.

[Bug c++/70410] New: no uninitialized variable warning if 'offsetof' is used in expression

2016-03-25 Thread sergiusthebest at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70410

Bug ID: 70410
   Summary: no uninitialized variable warning if 'offsetof' is
used in expression
   Product: gcc
   Version: 4.8.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: sergiusthebest at hotmail dot com
  Target Milestone: ---

You can easily reproduce the issue with the following code:

#include 

struct C
{
  int x;
  int y;
};

int main()
{
  int a;
  int b = a + offsetof(C, y); // <= missing warning that 'a' is uninitialized
  return b;
}