On Tue, Jan 3, 2012 at 5:53 AM, Hans-Peter Nilsson <hans-peter.nils...@axis.com> wrote: > All cross-builds are "still" done as C. In C++ you don't need > the missing struct qualifier or the typedef in "typedef struct > gfc_expr ... gfc_expr;" (the struct declaration suffices) as > there's no separate struct namespace IIUC. > > Doesn't this show a bug in the compatibility warning system, or > is that turned off when bootstrapping as C++?
It only works the other way around - warn for C when a construct is not compatible with C++. Thus it won't ever catch issues in frontends that are not compiled in stage1. Richard. > > Anyway, committed as obvious after a cris-elf build has passed > the point of failure, which looked as follows (first five lines > of errors). > > ... > gcc -c -DIN_GCC_FRONTEND -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -W > -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes > -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros > -Wno-overlength-strings -Wold-style-definition -Wc++-compat -fno-common > -DHAVE_CONFIG_H -I. -Ifortran -I/tmp/fail0102-96/gcc/gcc > -I/tmp/fail0102-96/gcc/gcc/fortran -I/tmp/fail0102-96/gcc/gcc/../include > -I/tmp/fail0102-96/gcc/gcc/../libcpp/include -I/tmp/fail0102-96/gccobj/./gmp > -I/tmp/fail0102-96/gcc/gmp -I/tmp/fail0102-96/gccobj/./mpfr > -I/tmp/fail0102-96/gcc/mpfr -I/tmp/fail0102-96/gcc/mpc/src > -I/tmp/fail0102-96/gcc/gcc/../libdecnumber > -I/tmp/fail0102-96/gcc/gcc/../libdecnumber/dpd -I../libdecnumber > /tmp/fail0102-96/gcc/gcc/fortran/arith.c -o fortran/arith.o > In file included from /tmp/fail0102-96/gcc/gcc/fortran/arith.c:31: > /tmp/fail0102-96/gcc/gcc/fortran/gfortran.h:1702: error: expected > specifier-qualifier-list before 'gfc_expr' > /tmp/fail0102-96/gcc/gcc/fortran/arith.c: In function 'gfc_arith_not': > /tmp/fail0102-96/gcc/gcc/fortran/arith.c:418: error: 'gfc_expr' has no member > named 'value' > /tmp/fail0102-96/gcc/gcc/fortran/arith.c:418: error: 'gfc_expr' has no member > named 'value' > /tmp/fail0102-96/gcc/gcc/fortran/arith.c: In function 'gfc_arith_and': > /tmp/fail0102-96/gcc/gcc/fortran/arith.c:432: error: 'gfc_expr' has no member > named 'value' > /tmp/fail0102-96/gcc/gcc/fortran/arith.c:432: error: 'gfc_expr' has no member > named 'value' > > fortran: > * gfortran.h (struct gfc_expr): Add missing "struct" > qualifier for member base_expr. > > Index: gcc/fortran/gfortran.h > =================================================================== > --- gcc/fortran/gfortran.h (revision 182825) > +++ gcc/fortran/gfortran.h (working copy) > @@ -1699,7 +1699,7 @@ typedef struct gfc_expr > > /* Used to store the base expression in component calls, when the expression > is not a variable. */ > - gfc_expr *base_expr; > + struct gfc_expr *base_expr; > > /* is_boz is true if the integer is regarded as BOZ bitpatten and is_snan > denotes a signalling not-a-number. */ > > brgds, H-P