[Bug c/33933] New: "error: array type has incomplete element type" in system header

danglin at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sun Oct 28 19:37:00 GMT 2007


The following test program results in the following error:

#include <sys/sysinfo.h>
int
main ()
{
  return 0;
}

-bash-3.2$ /opt/gnu/gcc/gcc-4.2.2/bin/gcc -S -O2  sinfo.c
In file included from sinfo.c:1:
/usr/include/sys/sysinfo.h:180: error: array type has incomplete element type

The offending line is:
extern struct syswait syswait[];

There seem to be quite a few similar instances in headers describing kernel
features.

This was discussed in this thread:
http://gcc.gnu.org/ml/gcc/2005-02/msg00054.html

In particular, the following DR was referenced as proof the above is
"not valid C":
http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_047.html

It says there regarding the submitted examples that "First of
all, no constraints are violated. Therefore, no diagnostics are required."
So, I'm questioning why a -pedantic warning was changed to a hard error
in gcc 4.0.0.  This seems to have been ignored in Joseph's response
and the subsequent change.


-- 
           Summary: "error: array type has incomplete element type" in
                    system header
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: danglin at gcc dot gnu dot org
 GCC build triplet: hppa2.0w-hp-hpux11.11
  GCC host triplet: hppa2.0w-hp-hpux11.11
GCC target triplet: hppa2.0w-hp-hpux11.11


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



More information about the Gcc-bugs mailing list