Article View: gnu.gcc.bug
Article #6167Re: Parse error?
From: Nathan Neulinger
Date: Wed, 20 Nov 1996 00:00
Date: Wed, 20 Nov 1996 00:00
62 lines
2221 bytes
2221 bytes
The point I think he was trying to make is that it wasn't a floating point
number?
It was the hex integer negative 0x2E, plus the integer value zero.
The compiler is interpreting it as a floating point number in exponential
form. It shouldn't be doing so since the 0x should indicate that the number
is in hex. Basically it looks like the "0x" is having lower precedence than
the "E" for exponential numbers.
-- Nathan
| It's not a bug. The ANSI C standard requires
| that a floating point constant should be specified
| using decimal digits only.
|
| The -0x2E+0 constant uses hexdecimal digits. Other
| compilers which allow it deviate from the standard.
|
| Bye,
| Eyal
|
|
|
| : Date: Sun, 17 Nov 96 08:40:14 IST
| : From: orid@taux01.nsc.com (Ori Dvir)
| : Message-Id: <9611170640.AA00525@tasu5k.nsc.com>
| : To: bug-gcc@prep.ai.mit.edu
| : Subject: Parse error?
| : Status: R
| :
| : Hi,
| :
| : I have a problem of parsing:
| : when i compile this file :
| :
| : main(){
| : int a;
| : a = 0x2e+0;
| : }
| :
| : >gcc t.c
| :
| : I get :
| :
| : t.c: In function `main':
| : t.c:6: garbage at end of number
| :
| : The expresion should stand for: 0x2e + 0 ( hex + decimal ).
| :
| : I'm using gcc version 2.7.2 on Sun meachines.
| :
| : Thanks,
| : Ori dvir : orid@taux01.nsc.com.il
| :
| :
------------------------------------------------------------
Nathan Neulinger Univ. of Missouri - Rolla
EMail: nneul@umr.edu Computing Services
WWW: http://www.umr.edu/~nneul SysAdmin: rollanet.org
Technical Details
Message-ID:
<nneul-ya023180002011961810430001@usenet.umr.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<9611170715.AA16220@dsp.co.il>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,39f8d0ab16fe7db1 X-Google-Attributes: gid113d02,public From: nneul@umr.edu (Nathan Neulinger) Subject: Re: Parse error? Date: 1996/11/20 Message-ID: <nneul-ya023180002011961810430001@usenet.umr.edu> X-Deja-AN: 197760767 sender: bug-gcc-request@prep.ai.mit.edu references: <9611170715.AA16220@dsp.co.il> content-type: text/plain; charset=ISO-8859-1 organization: University of Missouri - Rolla x-gateway: relay5.UU.NET from bug-gcc to gnu.gcc.bug; Wed, 20 Nov 1996 23:02:03 EST mime-version: 1.0 newsgroups: gnu.gcc.bug