On Fri, Nov 15, 2013 at 10:12:07PM +0100, Anton Khirnov wrote:
> limits.h defines {FLT,DBL}_{MAX,MIN} macros, even though float.h is
> supposed to do that. Those values are not exactly representable
> double/float as the specification mandates and the patched gcc treats
> them in extended precision (in violation of C99), which breaks code
> (e.g. in vf_fps) like
> 
> double f = DBL_MAX;
> [...]
> if (f == DBL_MAX) { // f has not been changed yet
>     [....]
> }
> ---
> At Janne's suggestion, changed the detection method to a compile check instead
> of hardcoding net/openbsd.
> 
> Fixed the description of the cause -- a patched gcc that violates the standard
> also collaborates on the breakage.
> ---

Did you report any of this to BSD devs?

> --- a/configure
> +++ b/configure
> @@ -963,6 +963,16 @@ check_builtin(){
>  
> +check_compile_assert(){
> +    log check_compile_assert "$@"
> +    name=$1
> +    headers=$2
> +    condition=$3
> +    shift 3
> +    disable "$name"
> +    check_code cc "$headers" "char c[!!($condition) - 1]" "$@" && enable 
> "$name"
> +}
> +
> @@ -3393,6 +3404,9 @@ if enabled_all ccc glibc; then
>  
> +check_compile_assert flt_lim "float.h limits.h" "DBL_MAX == (double)DBL_MAX" 
> ||
> +    add_cppflags '-I\$(SRC_PATH)/compat/limits'
> +

I'm not terribly fond of the name as I don't see any assertion being
invoked, nor do I think this test will be very reusable.  Just a check_cc
with a custom test should work in this case IMO.

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

Reply via email to