This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libm fixes for 16-bit targets


On Aug 31 23:30, jon@beniston.com wrote:
> Hi,
> 
> Attached are a couple of patches to libm to fix warnings when compiling for
> 16-bit targets.
> 
> The first in e_scalb.c calls scalbln instead of scalbn, as 65000 is out of
> range for an 'int'.
> 
> +#if INT_MAX == 32767
> +	if ( fn > 65000.0) return scalbln(x, 65000);
> +	if (-fn > 65000.0) return scalbln(x,-65000);
> +#else
>  	if ( fn > 65000.0) return scalbn(x, 65000);
>  	if (-fn > 65000.0) return scalbn(x,-65000);
> +#endif
> 
> The second in math_config.h (issignalingf_inline) fixes the signed overflow
> warning that occurs.
> 
> -  return 2 * (ix ^ 0x00400000) > 2u * 0x7fc00000;
> +  return 2 * (ix ^ 0x00400000) > 0xFF800000u;
> 
> Although I hope I'm not missing something subtle with the mixing of the
> types there.
> 
> Cheers,
> Jon
> 

Pushed.


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]