This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Adding a RID_* breaks C parser, why?


As part of an experiment I'm adding a builtin operator to the c++ parser
(similar to __typeof and __alignof).  The goals is to make it available
in C if desired, so I'm changing the list in c-common.h.

There's a comment above 'enum rid' about keeping the 27 modifiers within
a block at the beginning.  I haven't broken that rule.  (And there are 28
modifiers, not 27, but anyhow.)

The change looks like this:

  ...

  /* C extensions */
  RID_ASM,       RID_TYPEOF,   RID_ALIGNOF,  RID_ATTRIBUTE,  RID_VA_ARG,
  RID_EXTENSION, RID_IMAGPART, RID_REALPART, RID_LABEL,      RID_PTRBASE,
  RID_PTREXTENT, RID_PTRVALUE, RID_CHOOSE_EXPR, RID_TYPES_COMPATIBLE_P,
* RID_I_ADDED_MY_RID_RIGHT_HERE,

  /* Too many ways of getting the name of a function as a string */
  RID_FUNCTION_NAME, RID_PRETTY_FUNCTION_NAME, RID_C99_FUNCTION_NAME,
  ...


After that, and with no other change, and bootstrapping from scratch,
the stage1 build fails the first time the new compiler is used:

./xgcc -B./
-B/home/pme/build/install-2003-01-14/athlon_mp-pc-linux-gnu/bin/ -isystem
/home/pme/build/install-2003-01-14/athlon_mp-pc-linux-gnu/include -isystem
/home/pme/build/install-2003-01-14/athlon_mp-pc-linux-gnu/sys-include
-L/home/pme/build/build-2003-01-14/gcc/../ld -O2 -DIN_GCC    -W
-Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
-isystem ./include  -I. -I. -I/home/pme/src/unified/gcc
-I/home/pme/src/unified/gcc/. -I/home/pme/src/unified/gcc/config
-I/home/pme/src/unified/gcc/../include  -g0 -finhibit-size-directive
-fno-inline-functions -fno-exceptions -fno-zero-initialized-in-bss
-fno-omit-frame-pointer \
   -c /home/pme/src/unified/gcc/crtstuff.c -DCRT_BEGIN \
  -o crtbegin.o
/home/pme/src/unified/gcc/crtstuff.c: In function `__do_global_dtors_aux':
/home/pme/src/unified/gcc/crtstuff.c:257: error: parse error before "_Bool"
/home/pme/src/unified/gcc/crtstuff.c:256: warning: unused variable `p'
/home/pme/src/unified/gcc/crtstuff.c:213:1: unterminated #ifdef
/home/pme/src/unified/gcc/crtstuff.c:211:1: unterminated #ifdef
/home/pme/src/unified/gcc/crtstuff.c:150:1: unterminated #ifdef
make: *** [crtbegin.o] Error 1


....huh?  What could be that fragile?


Phil

-- 
I would therefore like to posit that computing's central challenge, viz. "How
not to make a mess of it," has /not/ been met.
                                                 - Edsger Dijkstra, 1930-2002


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]