Oleh Derevenko(deleted)
|
Re: POSIX incompatibility of constants from <float.h>
|
Oleh Derevenko(deleted)
05/02/2010 9:01 AM
post53373
|
Re: POSIX incompatibility of constants from <float.h>
> gcc/qcc defaults to C90 + GNU extensions. DBL_MAX and others were not
> required to be a constant expression in C90.
>
> "FLT_RADIX shall be a constant expression suitable for use in #if
> preprocessing directives; all other values need not be constant
> expressions."
>
> The requirement in C99 was added so the float values could be used as
> initializers. Our headers are conditioned based on __STDC_VERSION__ and
> so if you compile with -Wc,-std=c99 DBL_MAX will be defined as a
> constant expression. e.g. on x86 DBL_MAX will be 0xf.ffffffffffff8p+1020.
Interesting, what could be the benefit for such a constant of not being a constant expession? Was anybody going to take
an address of DBL_MAX? :) Or was it better for quality of code being compiled? :)
|
|
|