public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25955] New: regression: value computed not used warning with cast return value
@ 2006-01-25 6:30 mike at codeweavers dot com
2006-01-25 10:44 ` [Bug c/25955] [4.1/4.2 Regression] " rguenth at gcc dot gnu dot org
2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: mike at codeweavers dot com @ 2006-01-25 6:30 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1476 bytes --]
bash-3.00$ cat z1.c
int foo(void);
void bar(void) { (unsigned int)foo(); }
bash-3.00$ vi z1.c
bash-3.00$ /usr/local/gcc-4.1-branch/bin/gcc -c z1.c -Wall -O2
z1.c: In function bar:
z1.c:1: warning: value computed is not used
bash-3.00$ /usr/local/gcc-4.1-branch/bin/gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/usr/local/gcc-4.1-branch
--with-gnu-ld=/usr/local/binutils-2.16.1/bin/ld
--with-gnu-as=/usr/local/binutils-2.16.1/bin/as
Thread model: posix
gcc version 4.1.0 20060118 (prerelease)
Background:
Wine's windowsx.h defines:
#define ListBox_SetCurSel(hwndCtl, index) \
((int)SendMessage((hwndCtl), LB_SETCURSEL, (WPARAM)(int)(index), 0L))
Using this macro will give a warning in the gcc 4.1 branch, but not with gcc
4.0.2. Though the warning is technically correct, it doesn't really make much
sense, and I can't think of a real problem it's going to catch.
--
Summary: regression: value computed not used warning with cast
return value
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: mike at codeweavers dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i486-slackware-linux
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25955
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/25955] [4.1/4.2 Regression] value computed not used warning with cast return value
2006-01-25 6:30 [Bug c/25955] New: regression: value computed not used warning with cast return value mike at codeweavers dot com
@ 2006-01-25 10:44 ` rguenth at gcc dot gnu dot org
2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-01-25 10:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2006-01-25 10:44 -------
Confirmed. I wouldn't say the cast is an extra computation here - and we don't
warn without it.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
GCC build triplet|i686-pc-linux-gnu |
GCC host triplet|i486-slackware-linux |
GCC target triplet|i686-pc-linux-gnu |
Keywords| |diagnostic
Known to fail| |4.1.0 4.2.0
Known to work| |4.0.2
Last reconfirmed|0000-00-00 00:00:00 |2006-01-25 10:44:51
date| |
Summary|regression: value computed |[4.1/4.2 Regression] value
|not used warning with cast |computed not used warning
|return value |with cast return value
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25955
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug c/25955] [4.1/4.2 Regression] value computed not used warning with cast return value
2006-01-25 6:30 [Bug c/25955] New: regression: value computed not used warning with cast return value mike at codeweavers dot com
2006-01-25 10:44 ` [Bug c/25955] [4.1/4.2 Regression] " rguenth at gcc dot gnu dot org
@ 2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-25 13:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from pinskia at gcc dot gnu dot org 2006-01-25 13:06 -------
Actually we want to warn see PR 24900.
*** This bug has been marked as a duplicate of 24900 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25955
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-01-25 13:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-25 6:30 [Bug c/25955] New: regression: value computed not used warning with cast return value mike at codeweavers dot com
2006-01-25 10:44 ` [Bug c/25955] [4.1/4.2 Regression] " rguenth at gcc dot gnu dot org
2006-01-25 13:07 ` pinskia at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).