This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/26632] [4.1/4.2 Regression] spurious warning: value computed is not used
- From: "mattias at virtutech dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Mar 2006 15:30:25 -0000
- Subject: [Bug middle-end/26632] [4.1/4.2 Regression] spurious warning: value computed is not used
- References: <bug-26632-153@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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