public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/58183] New: Missing uninitialized warning
@ 2013-08-17 17:29 ash.winner.92 at gmail dot com
  2013-10-30 21:09 ` [Bug c/58183] " law at redhat dot com
  0 siblings, 1 reply; 2+ messages in thread
From: ash.winner.92 at gmail dot com @ 2013-08-17 17:29 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58183
           Summary: Missing uninitialized warning
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ash.winner.92 at gmail dot com

No uninitialized variable warning is displayed when compiling the following
code :

#include<stdio.h>

int main() {
    int i;
    while(i++<10)
        printf("%d Hello World!\n", i);
    return 0;
}

using the following command :

gcc -Wuninitialized test.c 


This is the output of gcc -v :

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro
4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs
--enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.7 --enable-shared --enable-linker-build-id
--with-system-zlib --libexecdir=/usr/lib --without-included-gettext
--enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7
--libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu
--enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object
--enable-plugin --enable-objc-gc --disable-werror --with-arch-32=i686
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1)


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug c/58183] Missing uninitialized warning
  2013-08-17 17:29 [Bug c/58183] New: Missing uninitialized warning ash.winner.92 at gmail dot com
@ 2013-10-30 21:09 ` law at redhat dot com
  0 siblings, 0 replies; 2+ messages in thread
From: law at redhat dot com @ 2013-10-30 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |law at redhat dot com
         Resolution|---                         |WONTFIX

--- Comment #1 from Jeffrey A. Law <law at redhat dot com> ---
You have to enable the optimizer to get uninitialized variable warnings.

Compiling your testcase with -O2 -Wuninitialized:


j.c: In function 'main':
j.c:5:12: warning: 'i' is used uninitialized in this function [-Wuninitialized]
     while(i++<10)
            ^


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-10-30 21:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-17 17:29 [Bug c/58183] New: Missing uninitialized warning ash.winner.92 at gmail dot com
2013-10-30 21:09 ` [Bug c/58183] " law at redhat dot com

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).