http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55671



             Bug #: 55671

           Summary: -Wconversion fails to warn for sign-conversion

    Classification: Unclassified

           Product: gcc

           Version: 4.7.2

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: c++

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: lo...@astron.nl





g++ doesn't warn about the following statement when using -Wconversion, whereas

gcc does.



$ cat Wconversion-bug.c 

unsigned i = -1;



$ g++ -Wconversion -c Wconversion-bug.c

[no output]



$ gcc -Wconversion -c Wconversion-bug.c 

Wconversion-bug.c:1:1: warning: negative integer implicitly converted to

unsigned type [-Wsign-conversion]



$ g++ --version

g++ (Ubuntu/Linaro 4.7.2-2ubuntu1) 4.7.2

Copyright (C) 2012 Free Software Foundation, Inc.

This is free software; see the source for copying conditions.  There is NO

warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Reply via email to