Re: [Bug?] compiler warning with gcc >= 4.2

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Nicolas Pitre
Date: Tuesday, July 3, 2007 - 7:18 am

On Tue, 3 Jul 2007, Frank Lichtenheld wrote:


Of course it can if the compiler blindly optimizes the test away.

In this particular case, the answer can be determined at compile time 
though, since all values to perform the test are constants.  So in this 
case the warning is rather obnoxious.

However it would be completely wrong if the compiler optimized away the 
if from index-pack.c on line 104, or from builtin-pack-objects.c on line 
579.  Even warning about it without actually optimizing it away would be 
bad in those cases.


I really wonder what's the point for gcc to warn about such things.  
Sure the warning should go away, but not by compromizing the test that 
we need performed on the actual definition of off_t.


Nicolas
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[Bug?] compiler warning with gcc >= 4.2, Frank Lichtenheld, (Tue Jul 3, 5:58 am)
Re: [Bug?] compiler warning with gcc >= 4.2, Nicolas Pitre, (Tue Jul 3, 7:18 am)
Re: [Bug?] compiler warning with gcc >= 4.2, Jan Hudec, (Fri Jul 6, 1:55 am)