This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Phase 1 of gcc-in-cxx now complete (Ada)
Laurent GUERBY <laurent@guerby.net> writes:
> Wanting to test Ada on the branch, after checkout I did on x86_64-linux:
>
> ../gcc/configure --enable-languages=c,c++,ada --enable-__cxa_atexit
> --disable-nls --enable-threads=posix --with-mpfr=/opt/cfarm/mpfr-2.4.1/
> --with-gmp=/opt/cfarm/gmp-4.2.4/ --prefix=/n/16/guerby/cxx/install
> --enable-build-with-cxx
>
> make bootstrap
> ...
> g++ -c -g -g -DIN_GCC -W -Wall -Wwrite-strings -Wcast-qual
> -Wmissing-format-attribute -fno-common -DHAVE_CONFIG_H -I. -I.
> -I../../gcc/gcc -I../../gcc/gcc/. -I../../gcc/gcc/../include
> -I../../gcc/gcc/../libcpp/include -I/opt/cfarm/gmp-4.2.4//include
> -I/opt/cfarm/mpfr-2.4.1//include -I../../gcc/gcc/../libdecnumber
> -I../../gcc/gcc/../libdecnumber/bid
> -I../libdecnumber ../../gcc/gcc/c-decl.c -o c-decl.o
> /usr/include/libintl.h:40: error: expected unqualified-id before âconstâ
> /usr/include/libintl.h:40: error: expected `)' before âconstâ
> /usr/include/libintl.h:40: error: expected initializer before âconstâ
> /usr/include/libintl.h:81: error: expected unqualified-id before âconstâ
> /usr/include/libintl.h:81: error: expected `)' before âconstâ
> /usr/include/libintl.h:81: error: expected initializer before âconstâ
> /usr/include/libintl.h:85: error: expected unqualified-id before âconstâ
> /usr/include/libintl.h:85: error: expected `)' before âconstâ
> /usr/include/libintl.h:85: error: expected initializer before âconstâ
I looked at this. It's due to the use of --disable-nls. That causes
gcc/intl.h in the gcc sources to do this:
# undef gettext
# define gettext(msgid) (msgid)
Later, gmp.h is #included. When gmp.h is compiled with C++, it
#includes <iosfwd> which (in gcc 4.1) #includes <bits/c++locale.h> which
#include <libintl.h>. libintl.h does this:
extern char *gettext (__const char *__msgid)
__THROW __attribute_format_arg__ (1);
which fails because of the #define of gettext.
I think the simple fix may be to always have gcc/intl.h include
<libintl.h> if it exists, to ensure that it does not get included later
after the gettext macro is defined.
Ian