[PATCH] Fix ggc-page.c c++ compat warning, restoring --enable-checking=all bootstrap.

Dave Korn dave.korn.cygwin@googlemail.com
Wed Dec 2 04:23:00 GMT 2009


    Hi,

  I tried configuring for the first time in a while with
--enable-checking=all, and got a c++-compat warning while building stage 2
gcc, breaking the bootstrap:

> /gnu/gcc/obj-libstdc-PR3187/./prev-gcc/xgcc -B/gnu/gcc/obj-libstdc-PR3187/./prev-gcc/ -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/bin/ -B/opt/gcc-tools/i686-pc-cygwin/lib/ -isystem /opt/gcc-tools/i686-pc-cygwin/include -isystem /opt/gcc-tools/i686-pc-cygwin/sys-include    -c  -g -O2 -gtoggle -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -Wold-style-definition -Wc++-compat -fno-common  -DHAVE_CONFIG_H -I. -I. -I/gnu/gcc/gcc/gcc -I/gnu/gcc/gcc/gcc/. -I/gnu/gcc/gcc/gcc/../include -I/gnu/gcc/gcc/gcc/../libcpp/include -I/usr/include -I/usr/include -I/gnu/gcc/gcc/gcc/../libdecnumber -I/gnu/gcc/gcc/gcc/../libdecnumber/dpd -I../libdecnumber  -DCLOOG_PPL_BACKEND    /gnu/gcc/gcc/gcc/alias.c -o alias.o
> cc1: warnings being treated as errors
> /gnu/gcc/gcc/gcc/ggc-page.c: In function ‘ggc_free’:
> /gnu/gcc/gcc/gcc/ggc-page.c:1419:12: error: struct defined in struct or union is not visible in C++
> /gnu/gcc/gcc/gcc/ggc-page.c:424:10: note: struct defined here
> /gnu/gcc/gcc/gcc/ggc-page.c:1419:30: error: struct defined in struct or union is not visible in C++
> /gnu/gcc/gcc/gcc/ggc-page.c:424:10: note: struct defined here
> /gnu/gcc/gcc/gcc/ggc-page.c:1419:30: error: struct defined in struct or union is not visible in C++
> /gnu/gcc/gcc/gcc/ggc-page.c:424:10: note: struct defined here
> /gnu/gcc/gcc/gcc/ggc-page.c: In function ‘validate_free_objects’:
> /gnu/gcc/gcc/gcc/ggc-page.c:1886:10: error: struct defined in struct or union is not visible in C++
> /gnu/gcc/gcc/gcc/ggc-page.c:424:10: note: struct defined here
> make[3]: *** [ggc-page.o] Error 1
> make[3]: *** Waiting for unfinished jobs....

  The attached patch allowed the build to proceed.  However I'm not going to
run this build to completion because the stage2 compiler is now taking in the
range four to eighteen (!) minutes solid cpu time per C source file while
building stage 3.  I didn't set out to investigate --enable-checking problems
but just idly turned it on to see what would happen, and it's a distraction
from what I was actually supposed to be doing that I would put up with if the
overhead wasn't quite as massive as that :-(

gcc/ChangeLog:

	* ggc-page.c (struct free_object): Pull definition out ...
	(struct globals): .. from here.

    cheers,
      DaveK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-checking-bootstrap.diff
Type: text/x-c
Size: 846 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20091202/e877dcd6/attachment.bin>


More information about the Gcc-patches mailing list