Thread View: gnu.gcc.bug
3 messages
3 total messages
Started by Eyal Ben-Avraham
Sun, 17 Nov 1996 00:00
Re: Parse error?
Author: Eyal Ben-Avraham
Date: Sun, 17 Nov 1996 00:00
Date: Sun, 17 Nov 1996 00:00
47 lines
1295 bytes
1295 bytes
Hi,
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
:
:
Re: Parse error?
Author: Koplien
Date: Tue, 19 Nov 1996 00:00
Date: Tue, 19 Nov 1996 00:00
4 lines
668 bytes
668 bytes
Hmmm, I can't see any floatingpoint.... In my eyes 0x2e is a hex number. Sorry, it is not bug, it is a feature, a special one. Henry
Re: Parse error?
Author: 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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads