This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/31153] -Wconversion does not catch return value mismatch



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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]