On Thu, Nov 17, 2005 at 02:54:48PM -0800, Richard Henderson wrote: > On Thu, Nov 17, 2005 at 02:01:56PM -0800, Ian Lance Taylor wrote: > > We traditionally do not warn about not using the value returned by a > > function. And I don't see why adding a cast should change that. > > Intuitively, a cast by itself is not a computation. > > In many cases is certainly is -- it's a value transformation; > zero extension, floating-point conversion, etc. > > My opinion is: why is the user asking for a value to be > transformed if they're not going to use the result?
As in the example, these cases will usually arise in macros, where under some circumstances some computation will be wasted.