https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81677

            Bug ID: 81677
           Summary: Can't declare pointer to array of incomplete type in
                    struct
           Product: gcc
           Version: 4.4.7
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chris.ol...@iti-global.com
  Target Milestone: ---

Created attachment 41898
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41898&action=edit
test.c is the original source file, test.i is the preprocessor output

The following declaration is considered erroneous on GCC 4.7.7 at the least:

struct s { struct s (*ps)[16] };

I don't see anything in the C90 standard that would forbid this and - although
Clang rejects it - MSC (Windows), XL C (AIX), Sun C (solaris) accepts this
declaration.

Attached is a source file that demonstrates the failure on GCC with this
command (and resulting error):

$ gcc -ansi test.c
test.c:4: error: array type has incomplete element type

$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla
--enable-bootstrap --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-gnu-unique-object
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk
--disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre
--enable-libgcj-multifile --enable-java-maintainer-mode
--with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib
--with-ppl --with-cloog --with-tune=generic --with-arch_32=i686
--build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)

$ uname -a
Linux name.domain 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013
x86_64 x86_64 x86_64 GNU/Linux

Reply via email to