-O1 -Winline

Mathieu Malaterre mmalater@nycap.rr.com
Thu Sep 16 00:39:00 GMT 2004


James E Wilson wrote:
> Mathieu Malaterre wrote:
> 
>>     I was playing with gcc flags to test if my code was robust. And I 
>> try -Winline, according to the doc I need to use -O1 also. But if I 
>> try to compile anything that use a bit of the stl I get tons of warnings.
> 
> 
> I don't hink -Winline does anything useful for C++ code.
> 
> -Winline means emit a warning if something was declared with the inline 
> keyword, but was not inlined by the compiler.  For C code, where inline 
> tends to be used sparingly, and only for functions that are likely to be 
> inlined, this warning may give you useful info.  For C++ code, where 
> inline tends to be used a lot, and some things are implicitly inline, 
> this warning will  just give you a lot of noise.

Ok, interesting. So I guess I'll just discard it. Just for the side 
note, it all began with xlC complaining about not able to inline some 
stl stuff in our code. then I tried gcc 3.3.* to double check, it gave 
me almost the same warnings. And yesterday I also tried 3.4.1, but it 
didn't emit even one single warning. Thus I thought there was something 
fixed in the 3.4.x branch that was not on 3.3...

Anyway, thanks for answering
Mathieu



More information about the Gcc mailing list