public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/39113] New: no warning that a variable may be used uninitialized
@ 2009-02-05 20:49 dhill at clusterresources dot com
2009-02-05 20:51 ` [Bug c/39113] " dhill at clusterresources dot com
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: dhill at clusterresources dot com @ 2009-02-05 20:49 UTC (permalink / raw)
To: gcc-bugs
$gcc -O -Wextra -save-temps um3.c
$
um3.c
#include <stdio.h>
main()
{
char *J;
if (rand())
J = NULL;
printf("\ntest %s\n",J);
}
In this example, J could be used uninitialized but the compiler is not giving
that warning.
--
Summary: no warning that a variable may be used uninitialized
Product: gcc
Version: 4.3.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dhill at clusterresources dot com
GCC build triplet: --build=x86_64-linux-gnu
GCC host triplet: --host=x86_64-linux-gnu
GCC target triplet: --target=x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39113
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/39113] no warning that a variable may be used uninitialized
2009-02-05 20:49 [Bug c/39113] New: no warning that a variable may be used uninitialized dhill at clusterresources dot com
@ 2009-02-05 20:51 ` dhill at clusterresources dot com
2009-02-05 21:04 ` dhill at clusterresources dot com
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: dhill at clusterresources dot com @ 2009-02-05 20:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dhill at clusterresources dot com 2009-02-05 20:51 -------
Created an attachment (id=17252)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17252&action=view)
.i file
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39113
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/39113] no warning that a variable may be used uninitialized
2009-02-05 20:49 [Bug c/39113] New: no warning that a variable may be used uninitialized dhill at clusterresources dot com
2009-02-05 20:51 ` [Bug c/39113] " dhill at clusterresources dot com
@ 2009-02-05 21:04 ` dhill at clusterresources dot com
2009-02-05 21:48 ` dhill at clusterresources dot com
2009-02-05 21:57 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: dhill at clusterresources dot com @ 2009-02-05 21:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dhill at clusterresources dot com 2009-02-05 21:04 -------
Here is the gcc -v output if that is helpful
$ gcc -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.3.2-1ubuntu12'
--with-bugurl=file:///usr/share/doc/gcc-4.3/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --enable-nls --with-gxx-include-dir=/usr/include/c++/4.3
--program-suffix=-4.3 --enable-clocale=gnu --enable-libstdcxx-debug
--enable-objc-gc --enable-mpfr --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.3.2 (Ubuntu 4.3.2-1ubuntu12)
--
dhill at clusterresources dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dhill at clusterresources
| |dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39113
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/39113] no warning that a variable may be used uninitialized
2009-02-05 20:49 [Bug c/39113] New: no warning that a variable may be used uninitialized dhill at clusterresources dot com
2009-02-05 20:51 ` [Bug c/39113] " dhill at clusterresources dot com
2009-02-05 21:04 ` dhill at clusterresources dot com
@ 2009-02-05 21:48 ` dhill at clusterresources dot com
2009-02-05 21:57 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: dhill at clusterresources dot com @ 2009-02-05 21:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dhill at clusterresources dot com 2009-02-05 21:48 -------
Note that the warning is correctly reported in older versions of the compiler.
The following example is from gcc 3.2.3
$ gcc -O -W um3.c
um3.c: In function `main':
um3.c:5: warning: `J' might be used uninitialized in this function
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2.3/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--disable-checking --with-system-zlib --enable-__cxa_atexit
--host=i386-redhat-linux
Thread model: posix
gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-59)
$ cat um3.c
#include <stdio.h>
main()
{
char *J;
if (rand())
J = NULL;
printf("\ntest %s\n",J);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39113
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c/39113] no warning that a variable may be used uninitialized
2009-02-05 20:49 [Bug c/39113] New: no warning that a variable may be used uninitialized dhill at clusterresources dot com
` (2 preceding siblings ...)
2009-02-05 21:48 ` dhill at clusterresources dot com
@ 2009-02-05 21:57 ` pinskia at gcc dot gnu dot org
3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-02-05 21:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2009-02-05 21:57 -------
*** This bug has been marked as a duplicate of 18501 ***
*** This bug has been marked as a duplicate of 18501 ***
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |DUPLICATE
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39113
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-02-05 21:57 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-05 20:49 [Bug c/39113] New: no warning that a variable may be used uninitialized dhill at clusterresources dot com
2009-02-05 20:51 ` [Bug c/39113] " dhill at clusterresources dot com
2009-02-05 21:04 ` dhill at clusterresources dot com
2009-02-05 21:48 ` dhill at clusterresources dot com
2009-02-05 21:57 ` 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).