This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/26632] [4.1/4.2 Regression] spurious warning: value computed is not used



------- Comment #3 from mattias at virtutech dot se  2006-03-10 15:30 -------
Yes, I realise it's the implicit integral conversion that causes the warning,
but since the result is not used no matter what it seems wrong to warn for it -
it cannot reasonably a sign of an error in the code.

It can be hard to avoid unless the exact types and sizes are known - for
instance, adding (long) casts to both branches will not prevent the warning
from being generated. This causes headaches with -Werror.

In fact, adding an (int) cast before h() will suppress the warning but a (long)
cast before g() will not. I see no sensible way of getting rid of the warning
at all, save casting the whole result to void (which isn't desirable for a
function-like macro).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26632


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