Article View: gnu.gcc.bug
Article #6258g++ 2.7.2 -Wuninitialized bug
From: Chris Metcalf
Date: Thu, 28 Dec 1995 00:00
Date: Thu, 28 Dec 1995 00:00
20 lines
1019 bytes
1019 bytes
The following piece of code produces no warnings under gcc with
"-Wuninitialized -O", but under g++ (i.e. with -xc++) it produces
"warning: `void * n' might be used uninitialized in this function".
Tested with 2.7.2 under i386-linux and sun4.
extern void *foo(void *l);
extern void *p;
void
bar(void *l)
{
void *n;
if (l == 0 || (n = foo(l)) == 0 || foo(n) == 0)
p = 0;
else
p = n;
}
Chris Metcalf -- MIT Lab for Computer Science, +1 617 253 7766
metcalf@lcs.mit.edu -- http://cag-www.lcs.mit.edu/~metcalf
Technical Details
Message-ID:
<199512281710.MAA00354@catfish.lcs.mit.edu>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,2b7ee0becc68dac0,start X-Google-Attributes: gid113d02,public From: metcalf@catfish.lcs.mit.edu (Chris Metcalf) Subject: g++ 2.7.2 -Wuninitialized bug Date: 1995/12/28 Message-ID: <199512281710.MAA00354@catfish.lcs.mit.edu> X-Deja-AN: 123052120 distribution: gnu sender: daemon@cis.ohio-state.edu organization: GNUs Not Usenet newsgroups: gnu.gcc.bug