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/64619] New: No -Wsign-conversion warning


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.
$: 
$:


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