public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Adding a RID_* breaks C parser, why?
@ 2003-01-15  8:51 Phil Edwards
  2003-01-15  8:54 ` Phil Edwards
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Edwards @ 2003-01-15  8:51 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Adding a RID_* breaks C parser, why?
  2003-01-15  8:51 Adding a RID_* breaks C parser, why? Phil Edwards
@ 2003-01-15  8:54 ` Phil Edwards
  0 siblings, 0 replies; 2+ messages in thread
From: Phil Edwards @ 2003-01-15  8:54 UTC (permalink / raw)
  To: gcc

On Tue, Jan 14, 2003 at 10:23:01PM -0500, Phil Edwards wrote:
> 
> ....huh?  What could be that fragile?

Never mind, I just found the "rid_to_yy" not-quite-duplicate array.  Ahem.


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-01-15  3:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-15  8:51 Adding a RID_* breaks C parser, why? Phil Edwards
2003-01-15  8:54 ` Phil Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).