public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/38945]  New: No warning when using unset variable
@ 2009-01-23 14:36 fredrik at hederstierna dot com
  2009-01-24 16:05 ` [Bug c/38945] No warning when using uninitialized variable manu at gcc dot gnu dot org
  2009-01-26 19:27 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: fredrik at hederstierna dot com @ 2009-01-23 14:36 UTC (permalink / raw)
  To: gcc-bugs

The 4.x compilers does not warn when using unset variables.
The 3.x compilers did warn on this:

Example:

int use_unset_variable(int y)
{
  int x;
  switch(y) {
  case 0:
    x = 0;
    break;
  default:
    break;
  }
  x++;
  return x;
}

Variable x could be unset when returning.
I use all warnings possible:

-Wall -W -Wextra

Best Regards
Fredrik


-- 
           Summary: No warning when using unset variable
           Product: gcc
           Version: 4.3.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fredrik at hederstierna dot com
 GCC build triplet: arm-elf-gcc
  GCC host triplet: x86-intel
GCC target triplet: arm-elf-gcc


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


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

end of thread, other threads:[~2009-01-26 19:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-23 14:36 [Bug c/38945] New: No warning when using unset variable fredrik at hederstierna dot com
2009-01-24 16:05 ` [Bug c/38945] No warning when using uninitialized variable manu at gcc dot gnu dot org
2009-01-26 19:27 ` 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).