Re: INFINITY and -pedantic with gcc
Re: INFINITY and -pedantic with gcc
- Subject: Re: INFINITY and -pedantic with gcc
- From: Markus Hitter <email@hidden>
- Date: Wed, 3 Aug 2005 23:23:31 +0200
Am 03.08.2005 um 20:59 schrieb Jasmin Lapalme:
I have curious bug with gcc and the option -pedantic.
Behaviour unexpected at the first glance isn't always a bug.
This code compiles well without the option -pedantic but I want to
use the option -pedantic. I want to be sure my code will compile on
any platform with gcc.
I don't think -pedantic helps you here. g++ is g++ on any platform,
especially at the front end side. Differences should be limited to
optimizer, assembler and linker.
I know that INFINITY is equal to 1e50f and 1e50f is greater than
FLT_MAX. The option -pedantic raise this error : floating constant
exceeds range of 'float'.
Raises immediately the question for me: Why would one knowingly want
to assign a value greater than FLT_MAX? Anything greater than a
Maximum is invalid, by definition. Do you want the positive or the
negative infinity, btw.?
Why I cannot use INFINITY with the option -pedantic?
Because -pedantic's reason of existence is to catch such oddities.
HTH,
Markus
- - - - - - - - - - - - - - - - - - -
Dipl. Ing. Markus Hitter
http://www.jump-ing.de/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden