unexpected parse error in #define

Zack Weinberg zackw@Stanford.EDU
Fri Oct 6 09:33:00 GMT 2000


On Fri, Oct 06, 2000 at 09:18:07AM -0700, Erik Talvola wrote:
> > > 
> > > [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.
> 
> 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

$ uudecode < message
$ cat -v test.c
^M
#define FOO a \^M
 { a(); }^M
^M
^M

In the version of GCC you are using, ^M is considered horizontal white
space, and prevents \-newline from continuing lines.

This has been fixed in the development tree, and may also have been
fixed in 2.95 - I thought it hadn't, but the copy installed on my
computer handles your file just fine.

zw


More information about the Gcc-bugs mailing list