public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/55125] New: declaration of the struct's array
@ 2012-10-29 19:19 hak1r at yahoo dot com
2012-10-29 19:41 ` [Bug c/55125] segfault when " mpolacek at gcc dot gnu.org
0 siblings, 1 reply; 2+ messages in thread
From: hak1r at yahoo dot com @ 2012-10-29 19:19 UTC (permalink / raw)
To: gcc-bugs
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: unassigned@gcc.gnu.org
ReportedBy: hak1r@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
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c/55125] segfault when declaration of the struct's array
2012-10-29 19:19 [Bug c/55125] New: declaration of the struct's array hak1r at yahoo dot com
@ 2012-10-29 19:41 ` mpolacek at gcc dot gnu.org
0 siblings, 0 replies; 2+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2012-10-29 19:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55125
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpolacek at gcc dot gnu.org
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> 2012-10-29 19:41:01 UTC ---
Can't reproduce with gcc4.7/trunk. BTW, to quash that warning, better write:
{ 'b', (const char *[]){ "qux", NULL } }.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-10-29 19:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-29 19:19 [Bug c/55125] New: declaration of the struct's array hak1r at yahoo dot com
2012-10-29 19:41 ` [Bug c/55125] segfault when " mpolacek at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).