public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/55271] New: missing warning set-but-unused
@ 2012-11-11 13:33 dimhen at gmail dot com
2012-11-11 17:24 ` [Bug middle-end/55271] " pinskia at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: dimhen at gmail dot com @ 2012-11-11 13:33 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55271
Bug #: 55271
Summary: missing warning set-but-unused
Classification: Unclassified
Product: gcc
Version: 4.8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: dimhen@gmail.com
$ cat test.c
void f()
{
// missing set-but-unused
char *li = 0;
*li = 0; // missing dereference-null ?
}
$ /usr/local/gcc_current_193387/bin/gcc -Wall -Wextra -Ofast test.c -c
$ /usr/local/gcc_current_193387/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current_193387/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current_193387/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /home/dimhen/src/gcc-current/configure
--prefix=/usr/local/gcc_current --with-multilib-list=m64 --enable-__cxa_atexit
--enable-shared --enable-checking=yes,df,fold,rtl,tree
--enable-gnu-unique-object --enable-linker-build-id
--enable-languages=c,c++,lto --enable-plugin
--enable-version-specific-runtime-libs --with-tune=generic
Thread model: posix
gcc version 4.8.0 20121110 (experimental) [trunk revision 193387] (GCC)
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/55271] missing warning set-but-unused
2012-11-11 13:33 [Bug middle-end/55271] New: missing warning set-but-unused dimhen at gmail dot com
@ 2012-11-11 17:24 ` pinskia at gcc dot gnu.org
2012-11-11 18:42 ` dimhen at gmail dot com
2012-11-11 20:24 ` jakub at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2012-11-11 17:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55271
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2012-11-11 17:24:19 UTC ---
The pointer is used in *li = 0; statement.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/55271] missing warning set-but-unused
2012-11-11 13:33 [Bug middle-end/55271] New: missing warning set-but-unused dimhen at gmail dot com
2012-11-11 17:24 ` [Bug middle-end/55271] " pinskia at gcc dot gnu.org
@ 2012-11-11 18:42 ` dimhen at gmail dot com
2012-11-11 20:24 ` jakub at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: dimhen at gmail dot com @ 2012-11-11 18:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55271
--- Comment #2 from Dmitry G. Dyachenko <dimhen at gmail dot com> 2012-11-11 18:42:25 UTC ---
oh, was over-simplified example. Sorry
void f1()
{
char ch;
char *p = &ch;
*p = 0;
}
Now 2 variables are 'set-but-unused'?
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/55271] missing warning set-but-unused
2012-11-11 13:33 [Bug middle-end/55271] New: missing warning set-but-unused dimhen at gmail dot com
2012-11-11 17:24 ` [Bug middle-end/55271] " pinskia at gcc dot gnu.org
2012-11-11 18:42 ` dimhen at gmail dot com
@ 2012-11-11 20:24 ` jakub at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-11-11 20:24 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55271
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
CC| |jakub at gcc dot gnu.org
Resolution| |INVALID
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-11-11 20:24:39 UTC ---
No, they are both used. ch in &ch, and p in *p.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-11-11 20:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-11 13:33 [Bug middle-end/55271] New: missing warning set-but-unused dimhen at gmail dot com
2012-11-11 17:24 ` [Bug middle-end/55271] " pinskia at gcc dot gnu.org
2012-11-11 18:42 ` dimhen at gmail dot com
2012-11-11 20:24 ` jakub at gcc dot gnu.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).