This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: preprocessor/8449: Ellipsis in 3...5 not recognized properly
- From: Neil Booth <neil at daikokuya dot co dot uk>
- To: ehrhardt at mathematik dot uni-ulm dot de
- Cc: gcc-gnats at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org
- Date: Thu, 7 Nov 2002 08:24:59 +0000
- Subject: Re: preprocessor/8449: Ellipsis in 3...5 not recognized properly
- References: <20021104162425.31121.qmail@sources.redhat.com>
ehrhardt@mathematik.uni-ulm.de wrote:-
> Compiling this:
>
> int a[2] = {[0 ...1]=1};
>
> with gcc -c t.c gives an error:
> gcc -c t9.c
> t9.c:1: too many decimal points in floating constant
> The cause is quite obious: The ellipsis is parsed as part of the
> number. Something along these lines might fix it (only compile tested
> as of yet)
As I expected, I couldn't reproduce this. Could you elaborate?
Are you using stock GCC? The code in cpplex.c IMO clearly handles
ellipses correctly, even with escaped newlines, and has nothing to
do with numbers:
case '.':
result->type = CPP_DOT;
c = get_effective_char (pfile);
if (c == '.')
{
const unsigned char *pos = buffer->cur;
if (get_effective_char (pfile) == '.')
result->type = CPP_ELLIPSIS;
else
buffer->cur = pos - 1;
}
So, assuming the case '.' code is reached, which it would appear to
be since the "..." appears after whitespace (which causes a loop back
to re-enter the switch) I don't see how this can fail.
What ASCII character is after the '0' in your line above? Maybe it's
not be the space it appears to be.
Neil.