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++/50810] New: c++0x-compat does not warn about narrowing conversions


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

             Bug #: 50810
           Summary: c++0x-compat does not warn about narrowing conversions
    Classification: Unclassified
           Product: gcc
           Version: 4.6.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: public@alisdairm.net


The following program is rejected by g++ in -std=c++0x mode (assuming 'char' is
signed) but does not raise any warnings when compiled with -Wc++0x-compat:


int main() {
   char data[] = { 0xff };
   char value = 0xff;
}


This is significantly the largest source of compatibility errors in our
code-base today (>95% of our known issues), so it would be very useful if the
warning caught these.


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