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++/51755] New: -Wconversion generates false warnings when the ternary operator is used


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

             Bug #: 51755
           Summary: -Wconversion generates false warnings when the ternary
                    operator is used
    Classification: Unclassified
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: james.kanze@gmail.com


This might be covered by 40752; it's related.  But if -Wconversion is used,
simple code like the following

    int main()
    {
        static uint8_t const k = 0x02;
        bool c = true;
        uint8_t x = 0;
        x |= c ? k : 0;
    }

triggers a warning, although there is absolutely no possibility of overflow.


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