This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64619] New: No -Wsign-conversion warning
- From: "chengniansun at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 16 Jan 2015 00:41:21 +0000
- Subject: [Bug c/64619] New: No -Wsign-conversion warning
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64619
Bug ID: 64619
Summary: No -Wsign-conversion warning
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: chengniansun at gmail dot com
I think "a" should be converted to unsigned long, so there is a signedness
change in this expression.
$: cat s.c
int a;
void fn() /* */
{
a ^ 0x1UL;
}
$:
$: gcc-trunk -Wsign-conversion s.c -c
$:
$: clang-trunk -Wno-unused-value -Wsign-conversion s.c -c
s.c:4:3: warning: implicit conversion changes signedness: 'int' to
'unsigned long' [-Wsign-conversion]
a ^ 0x1UL;
^ ~
1 warning generated.
$:
$: