This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31153] -Wconversion does not catch return value mismatch
- From: "craig dot lawson at centrify dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2007 18:53:05 -0000
- Subject: [Bug c/31153] -Wconversion does not catch return value mismatch
- References: <bug-31153-9156@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from craig dot lawson at centrify dot com 2007-03-12 18:53 -------
Test program (Create a New Attachment is not working for me today):
const int i = -1;
unsigned int slip_one_by()
{
return i;
}
unsigned int caught_me()
{
return -1;
}
$ gcc -c unsigned_return.c -Wconversion
unsigned_return.c: In function `caught_me':
unsigned_return.c:10: warning: negative integer implicitly converted to
unsigned type
Expected a warning for line 5, too.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31153