This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: unexpected parse error in #define
- To: Zack Weinberg <zackw at stanford dot edu>
- Subject: Re: unexpected parse error in #define
- From: Erik Talvola <talvola at yahoo dot com>
- Date: Fri, 6 Oct 2000 09:18:07 -0700 (PDT)
- Cc: gcc-bugs at gcc dot gnu dot org
> > I wouldn't normally expect that continuations
> lines
> > would be treated differently when using #define
> with a
> > macro that takes arguments vs. one which doesn't.
> > Didn't see anything in the CPP manual which
> describes
> > this, but don't have a copy of the ANSI standard
> to
> > know whether this is specified or not:
> >
> > [etalvo@hobo etalvo]$ more test.c
> >
> > #define FOO a \
> > { a(); }
> >
> > [etalvo@hobo etalvo]$ more test3.c
> >
> > #define FOO(r) a \
> > { a(); }
> >
> > [etalvo@hobo etalvo]$ gcc -c test.c
> > test.c:3: parse error before `{'
> > [etalvo@hobo etalvo]$ gcc -c test3.c
> > [etalvo@hobo etalvo]$
>
> The odds are overwhelming that the actual problem is
> that there's a
> space at the end of line 2 of test.c. In all
> released versions of
> GCC, \-newline doesn't trigger continuation if
> there's whitespace
> between the \ and the end of the line.
>
> We recently discussed changing this but I don't
> remember if it was
> implemented or not.
>
> zw
There is definitely no space there. That's what I
first suspected in the original code, but it's not the
case here.
begin 644 test.c
B#0HC9&5F:6YE($9/3R!A(%P-"B![(&$H*3L@?0T*#0H-"@``
`
end
--erik
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/