The reduced code below used to successfully compile on previous releases of
GCC. I can get this code to compile with GCC 4.1.2, but when I try it with GCC
4.3.4, I get the following error message:
a.c: In function 'main':
a.c:4: error: storage size of 'test' isn't known

Clearly, this is happening because the struct in6_pktinfo is not defined
anywhere before a variable of that type is declared. Looking into the header
file, the struct definition is guarded by a macro __USE_GNU. I have come to
understand that to get this macro defined (thus get the struct defined), one
would define the macro _GNU_SOURCE before including the GCC header files. This
way, types like the in6_pktinfo struct can be defined.
However, this is causing compiler failures for us, and it's not feasible for us
to define this macro (whether on command line, or inside source code) files.
Please take a look and see if this change is unavoidable, and whether there is
a way to reverse it.

Reduced Source Code:
#include <netinet/in.h>
int main()
{
        struct in6_pktinfo test;
}


-- 
           Summary: struct in6_pktinfo is guarded by __USE_GNU macro
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: murtadha at ca dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45257

Reply via email to