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

             Bug #: 55125
           Summary: declaration of the struct's array
    Classification: Unclassified
           Product: gcc
           Version: 4.6.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: ha...@yahoo.com


Created attachment 28564
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28564
at the requests of workers :)

1. gcc version

hak1r@HPBM ~/Dropbox/progs $ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.6/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.6.3-1ubuntu5' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.6 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --enable-targets=all --disable-werror
--with-arch-32=i686 --with-tune=generic --enable-checking=release
--build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.6.3 (Ubuntu/Linaro 4.6.3-1ubuntu5) 

2. system info

hak1r@HPBM ~/Dropbox/progs $ uname -a
Linux HPBM 3.2.0-32-generic #51-Ubuntu SMP Wed Sep 26 21:32:50 UTC 2012 i686
i686 i386 GNU/Linux

3. and my trick

hak1r@HPBM ~/Dropbox/progs $ gcc main.c 
main.c: In function ‘main’:
main.c:9:9: warning: initialization from incompatible pointer type [enabled by
default]
main.c:9:9: warning: (near initialization for ‘(anonymous)’) [enabled by
default]
main.c:9:9: warning: excess elements in scalar initializer [enabled by default]
main.c:9:9: warning: (near initialization for ‘(anonymous)’) [enabled by
default]
main.c:7:7: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.6/README.Bugs> for instructions.
Preprocessed source stored into /tmp/ccUJNmU4.out file, please attach this to
your bugreport.

4. source file

main.c:
  1 #include <stdlib.h>
  2 
  3 int main(int argc, char **argv) {
  4     const struct {
  5         char foo;
  6         const char **bar;
  7     } baz[] = {
  8         { 'a', (const char **){ NULL } },
  9         { 'b', (const char **){ "qux", NULL } }
 10     };
 11     return 0;
 12 }
 13

Reply via email to