Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
- Subject: Re: GCC for i386 allows 'invalid suffix "f" on integer constant'
- From: Dirk Stegemann <email@hidden>
- Date: Sat, 21 Jan 2006 00:16:07 +0200
Hello,
Am 20.01.2006 um 23:24 schrieb Chris Espinosa:
'2' is an integer literal, and only combinations of [ulUL] are
allowed for integer literals. '2' is an invalid floating literal,
as it has neither a fraction part nor an exponent. It cannot be
typed as a float with "F" because it is not a floating literal.
Use 2.F or 2.0F instead.
You're right, and those variants work fine.
But the problem isn't that {float f = 2f;} compiles or doesn't
compile, but that it behaves differently dependent on the -arch flag.
Our tools have to respond to other developers' C++ code, and it would
be somewhat painful if we'd have to take different codepaths
dependent on the architecture they want to compile their code for.
Fortunately, this issue isn't very likely to become a real-world
problem, because view developers would write such code in the first
place in case they want to support PPC architecture as well...
gcc is incorrect in failing to report the error when compiling with
-arch i386, as the program is ill-formed according to the C standard.
That's what I guessed, thanks for the confirmation.
So I'll file a bug report.
Regards,
Dirk Stegemann
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden