This is the mail archive of the gcc-patches@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]

Re: integer parsing overhaul, revised


On Tue, Aug 28, 2001 at 07:52:36AM +0100, Neil Booth wrote:
> I wrote:-
> 
> > Just curious; does this mean we silently accept
> > 
> > #line -10
> > 
> > and convert it to an unsigned long (perhaps with a warning about the
> > number being too large)?
> 
> Err, stupid question, please ignore :-)

Well, it does point out that the error message is kinda lame:

$ ./cpp0
#line -10
# 1 "<stdin>"
# 1 "<builtin>"
# 1 "<command line>"
# 1 "<stdin>"
<stdin>:1:7: "-" after #line is not a number

might want to special case CPP_MINUS immediately followed by CPP_NUMBER
and say something like "negative numbers are not valid in #line".  I
don't think most people realize that the - in -10 is not part of the
integer literal.

zw


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