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++/55671] New: -Wconversion fails to warn for sign-conversion


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: unassigned@gcc.gnu.org
        ReportedBy: loose@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.


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