On Tue, 19 Nov 2013 13:20:22 -0800, Martynas Venckus <[email protected]> wrote:
> Thanks, Anton.
> 
> You can't do explicit casts as the standard mandates that those macros be
> constant expressions.

Using a cast does not prevent it from being a constant expression. In fact the
relevant chapter in the C99 standard (6.6) explicitly mentions casts in this
context as permitted.

> 
> Moreover, GCC itself exports those exact same values via __DBL_MAX
> builtins, which are not double-precision anymore when used.  Please be sure
> to report this to GCC.
>

The value provided by newer gcc versions is explicitly cast to double.
$ gcc-4.4 -dM -E - < /dev/null|grep __DBL_MAX__
#define __DBL_MAX__ 1.7976931348623157e+308
$ gcc-4.8 -dM -E - < /dev/null|grep __DBL_MAX__
#define __DBL_MAX__ ((double)1.79769313486231570815e+308L)

So the problem only occurs because the value declared in your header is not
treated as double.

-- 
Anton Khirnov
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to