delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/05/15/13:54:25

Date: Mon, 15 May 95 10:21 MDT
From: mat AT ardi DOT com (Mat Hostetter)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Re: BUG or what?! -- No
References: <Chameleon.950514192150.pdasilva@> <199505151346 DOT PAA15216 AT tyr DOT diku DOT dk>

>>>>> "Morten" == Morten Welinder <terra AT diku DOT dk> writes:

    Morten> The C language requires you to have whitespace between a
    Morten> hex-number ending in "e" and a subsequent "+" or "-".

Exactly.  Otherwise gcc is forced to parse it as an exponent.  From
the gcc docs:

   * GNU C complains about program fragments such as `0x74ae-0x4000'
     which appear to be two hexadecimal constants separated by the minus
     operator.  Actually, this string is a single "preprocessing token".
     Each such token must correspond to one token in C.  Since this
     does not, GNU C prints an error message.  Although it may appear
     obvious that what is meant is an operator and two values, the ANSI
     C standard specifically requires that this be treated as erroneous.

     A "preprocessing token" is a "preprocessing number" if it begins
     with a digit and is followed by letters, underscores, digits,
     periods and `e+', `e-', `E+', or `E-' character sequences.

     To make the above program fragment valid, place whitespace in
     front of the minus sign.  This whitespace will end the
     preprocessing number.

-Mat

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019