[Bug c/100671] override-init suppressed in 'two shot' compilation when initializer macro/value is defined in system header file

2021-05-19 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100671

--- Comment #2 from Andrew Pinski  ---
I think this is a dup of bug 99791.

[Bug c/100671] override-init suppressed in 'two shot' compilation when initializer macro/value is defined in system header file

2021-05-19 Thread jan.smets at nokia dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100671

--- Comment #1 from Jan Smets  ---
Another one we've had problems with is quite similar. The example below is a
void function trying to return a value. 

#if 1
  /* NULL defined in a system header file
=> warning in "one shot" compilation.
=> no warning in "two shot" compilation. */
  #include 
#else
  /* always warns */
  #define NULL (0L)
#endif

void test(void)
{
return NULL;
}