Bug 33327 - gcc 4.{1,2} fail warn uninitialized
Summary: gcc 4.{1,2} fail warn uninitialized
Status: RESOLVED DUPLICATE of bug 18501
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.1.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-06 21:52 UTC by Mark Hindley
Modified: 2007-09-06 22:30 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hindley 2007-09-06 21:52:54 UTC
gcc 4.1 and 4.2 fail to warn about an uninitialized variable in the following testcase. gcc 3.3 correctly warns.

int 
foo(int i)
{
  int err;
  
  if (i) {
    err = 1;
  }
  return err;
}

Verified on 

gcc-4.2 (GCC) 4.2.1 (Debian 4.2.1-3)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 1 Andrew Pinski 2007-09-06 22:30:28 UTC

*** This bug has been marked as a duplicate of 18501 ***