I tried compiling the 4.8.0 gcc release with the 4.7.2 compiler with a specs file that defaulted to std=c++11. I found problems with incompatibilities between the old c++ standard and the new.

I recommend that the sources be made C++11 compilable. I also recommend that the style rules encourage whitespace between strings and legal identifier characters.

I had many errors of the kind:

g++ -c -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.8.0/gcc -I../../gcc-4.8.0/gcc/. -I../../gcc-4.8.0/gcc/../include -I../../gcc-4.8.0/gcc/../libcpp/include -I/home/sidney/objdir4.8.0/./gmp -I/home/sidney/gcc-4.8.0/gmp -I/home/sidney/objdir4.8.0/./mpfr -I/home/sidney/gcc-4.8.0/mpfr -I/home/sidney/gcc-4.8.0/mpc/src -I../../gcc-4.8.0/gcc/../libdecnumber -I../../gcc-4.8.0/gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc-4.8.0/gcc/../libbacktrace ../../gcc-4.8.0/gcc/bitmap.c -o bitmap.o ../../gcc-4.8.0/gcc/bitmap.c: In function 'int print_statistics(void**, void*)': ../../gcc-4.8.0/gcc/bitmap.c:2164:64: error: unable to find string literal operator 'operator"" HOST_WIDEST_INT_PRINT'
../../gcc-4.8.0/gcc/bitmap.c: In function 'void dump_bitmap_statistics()':
../../gcc-4.8.0/gcc/bitmap.c:2197:64: error: unable to find string literal operator 'operator"" HOST_WIDEST_INT_PRINT'

This error is caused by a change in the definition of preprocessing tokens in the new standard causing "xxx"HOST to be parsed as a single token and then interpreted as a user defined string literal. (There are also new string preprocessing tokens like R"xxx" which might also lead to future problems.) I corrected several dozen instances of this in the sources. I believe that all of these errors can be found by grepping for |"HOST"| and replacing it with |" HOST"|. (There may be strings in the source that start with "HOST ..." that this pattern would match but I didn't see any.) There are also strings concatenated with identifiers on the other side which may lead to future incompatibilities.

The remaining error was:

g++ -c -DIN_GCC_FRONTEND -g -DIN_GCC -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common -DHAVE_CONFIG_H -I. -Icp -I../../gcc-4.8.0/gcc -I../../gcc-4.8.0/gcc/cp -I../../gcc-4.8.0/gcc/../include -I../../gcc-4.8.0/gcc/../libcpp/include -I/home/sidney/objdir4.8.0/./gmp -I/home/sidney/gcc-4.8.0/gmp -I/home/sidney/objdir4.8.0/./mpfr -I/home/sidney/gcc-4.8.0/mpfr -I/home/sidney/gcc-4.8.0/mpc/src -I../../gcc-4.8.0/gcc/../libdecnumber -I../../gcc-4.8.0/gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc-4.8.0/gcc/../libbacktrace ../../gcc-4.8.0/gcc/cp/except.c -o cp/except.o
In file included from ../../gcc-4.8.0/gcc/cp/except.c:1005:0:
cfns.gperf: In function 'const char* libc_name_p(const char*, unsigned int)':
cfns.gperf:101:1: error: 'const char* libc_name_p(const char*, unsigned int)' redeclared inline with 'gnu_inline' attribute cfns.gperf:26:14: error: 'const char* libc_name_p(const char*, unsigned int)' previously declared here
cfns.gperf: At global scope:
cfns.gperf:26:14: warning: inline function 'const char* libc_name_p(const char*, unsigned int)' used but never defined [enabled by default]

I commented out the inline attribute line in cfns.h - I am not sure about the source of this error but I believe this error is a change in a gcc extension.

After this correction I got everything to compile. To check I deleted the object directory and did a completely new make from scratch. Everything appeared to work.

This message is designed to be helpful and is not in any way a complaint. I really appreciate the excellent work done by the gcc people.

--Sidney Marshall

Reply via email to