PATCH to libiberty
Gabriel Dos Reis
gdr@integrable-solutions.net
Sat Dec 17 17:25:00 GMT 2005
Configuring mainline and compiling with -Wc++-compat turns up these
regressions in libiberty. Fixed thusly.
I submitted a patch ago to add -Wc++-format to libiberty Makefile to
prevent this sort of things. I'll revive it for mainline.
-- Gaby
2005-12-17 Gabriel Dos Reis <gdr@integrable-solutions.net>
* floatformat.c (floatformat_i387_ext_is_valid): Use explicit cast
to convert from "from".
(floatformat_to_double): Likewise.
(floatformat_from_double): Use explicit cast to convert from "to".
*** floatformat.c (revision 108719)
--- floatformat.c (local)
*************** floatformat_i387_ext_is_valid (const str
*** 143,149 ****
nor ~0, the intbit must also be set. Only if the exponent is
zero can it be zero, and then it must be zero. */
unsigned long exponent, int_bit;
! const unsigned char *ufrom = from;
exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
fmt->exp_start, fmt->exp_len);
--- 143,149 ----
nor ~0, the intbit must also be set. Only if the exponent is
zero can it be zero, and then it must be zero. */
unsigned long exponent, int_bit;
! const unsigned char *ufrom = (const unsigned char *) from;
exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
fmt->exp_start, fmt->exp_len);
*************** void
*** 295,301 ****
floatformat_to_double (const struct floatformat *fmt,
const void *from, double *to)
{
! const unsigned char *ufrom = from;
double dto;
long exponent;
unsigned long mant;
--- 295,301 ----
floatformat_to_double (const struct floatformat *fmt,
const void *from, double *to)
{
! const unsigned char *ufrom = (const unsigned char *) from;
double dto;
long exponent;
unsigned long mant;
*************** floatformat_from_double (const struct fl
*** 471,477 ****
double mant;
unsigned int mant_bits, mant_off;
int mant_bits_left;
! unsigned char *uto = to;
dfrom = *from;
memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
--- 471,477 ----
double mant;
unsigned int mant_bits, mant_off;
int mant_bits_left;
! unsigned char *uto = (unsigned char *) to;
dfrom = *from;
memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
More information about the Gcc-patches
mailing list