This is the mail archive of the glibc-linux@ricardo.ecn.wfu.edu mailing list for the glibc project.


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

Re: gcc -O -Wconversion with glibc2 - warnings from headers.


Gael Queri <gqueri@mail.dotcom.fr> writes 
[from the FAQ - thanks, I missed that, OG]:

> -Wconversion isn't really intended for production use, only for shakedown
> compiles after converting an old program to standard C.

I didn't say we were using -Wconversion for production. I only said we
found it useful as a "shakedown" tool to verify that our code was as
clean as possible. In this sense I disagree (to some extent) with the
last clause of cited statement - I'd put a fullstop after "only for
shakedown compiles", which is exactly what we are doing.

A favourite example of some of us is

/* foo.c */
/* We meant to use fabs(). Including <stdlib.h> does not change
   anything */
#include <math.h>
int main(void) {
    return (abs(-2.5) > abs(-2.1)) ? 0 : 1;
}

-Wconversion catches things like this.

Anyway, thanks for pointing out the FAQ that I missed.

-- 
Oleg Goldshmidt | BLOOMBERG L.P. (BFM) | oleg@NOSPAM.bfr.co.il
"... We work by wit, and not by witchcraft; 
 And wit depends on dilatory time." - W. Shakespeare.

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