This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Uninitialized use warning message
- From: Kean Johnston <jkj at sco dot com>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 26 Aug 2005 15:05:48 -0700
- Subject: Uninitialized use warning message
- Reply-to: jkj at sco dot com
Hello everyone,
There is a warning message I would dearly love to see improved
a little. Its the one where you use a variable without it being
initialized first:
foo.c:123: warning: `foo' might be used unitialized in this function
Obviously, there was some code somewhere that used variable
`foo' to trigger the warning. What I would dearly love to see
is the warning message be a bit more informative, along the
lines of:
foo.c:123: warning: `foo' might be used unitialized in this function
foo.c:234: warning: possible use of unitialized `foo'
foo.c:345: warning: possible use of unitialized `foo'
You get the idea. Does anyone else think this would be useful?
Do we even have sufficient data available to be able to produce
such warnings? I figured I'd ask first before diving into the code.
Kean