public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/5284: missing warning on uninitialized variable
@ 2002-09-15 12:26 nathan
  0 siblings, 0 replies; 2+ messages in thread
From: nathan @ 2002-09-15 12:26 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, nobody, peter.barth

Synopsis: missing warning on uninitialized variable

State-Changed-From-To: open->analyzed
State-Changed-By: nathan
State-Changed-When: Sun Sep 15 12:26:57 2002
State-Changed-Why:
    confirmed. No warning at -W -Wall -O2

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5284


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

* c++/5284: missing warning on uninitialized variable
@ 2002-01-05  1:36 peter.barth
  0 siblings, 0 replies; 2+ messages in thread
From: peter.barth @ 2002-01-05  1:36 UTC (permalink / raw)
  To: gcc-gnats


>Number:         5284
>Category:       c++
>Synopsis:       missing warning on uninitialized variable
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 05 01:36:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     peter.barth@t-online.de
>Release:        gcc-2.95.3, gcc-3.0
>Organization:
>Environment:
SuSe Linux 7.3
>Description:
GCC should issue a warning on
           int j = (j < 0) ? -i : i;
that j is used uninitialized (some other compilers do).
Complete code snippet
---
#include <iostream>
using namespace std;

int f(int i) 
{
  int j = (j < 0) ? -i : i; // shouldn't that generate a warning that j is used uninitialized
  return j;
}

int main()
{
  int h = 3;
  cout << h << " " << f(h) << "\n";
  h = -3;
  cout << h << " " << f(h) << "\n";
  return 0;
}
---
>How-To-Repeat:
#include <iostream>
using namespace std;

int f(int i) 
{
  int j = (j < 0) ? -i : i; // shouldn't that generate a warning that j is used uninitialized
  return j;
}

int main()
{
  int h = 3;
  cout << h << " " << f(h) << "\n";
  h = -3;
  cout << h << " " << f(h) << "\n";
  return 0;
}
>Fix:
???
>Release-Note:
>Audit-Trail:
>Unformatted:


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

end of thread, other threads:[~2002-09-15 19:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-15 12:26 c++/5284: missing warning on uninitialized variable nathan
  -- strict thread matches above, loose matches on Subject: below --
2002-01-05  1:36 peter.barth

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