<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in warn-bitfield-enum-conversion.cpp</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>329f24d6 - Warn on enum assignment to bitfields that can&apos;t fit all values</title>
        <link>http://172.16.0.5:8080/history/llvm-project-15.0.7/clang/test/SemaCXX/warn-bitfield-enum-conversion.cpp#329f24d6</link>
        <description>Warn on enum assignment to bitfields that can&apos;t fit all valuesThis adds -Wbitfield-enum-conversion, which warns on implicitconversions that happen on bitfield assignment that change the value ofsome enumerators.Values of enum type typically take on a very small range of values, sothey are frequently stored in bitfields. Unfortunately, there is noconvenient way to calculate the minimum number of bits necessary tostore all possible values at compile time, so users usually hard code abitwidth that works today and widen it as necessary to pass basictesting and validation. This is very error-prone, and leads to stalewidths as enums grow. This warning aims to catch such bugs.This would have found two real bugs in clang and two instances ofquestionable code. See r297680 and r297654 for the full description ofthe issues.This warning is currently disabled by default while we investigate itsusefulness outside of LLVM.The major cause of false positives with this warning is this kind ofenum:  enum E { W, X, Y, Z, SENTINEL_LAST };The last enumerator is an invalid value used to validate inputs or sizean array. Depending on the prevalance of this style of enum across acodebase, this warning may be more or less feasible to deploy. It alsohas trouble on sentinel values such as ~0U.Reviewers: rsmith, rtrieu, thakisReviewed By: thakisSubscribers: hfinkel, voskresensky.vladimir, sashab, cfe-commitsDifferential Revision: https://reviews.llvm.org/D30923llvm-svn: 297761

            List of files:
            /llvm-project-15.0.7/clang/test/SemaCXX/warn-bitfield-enum-conversion.cpp</description>
        <pubDate>Tue, 14 Mar 2017 18:01:02 +0000</pubDate>
        <dc:creator>Reid Kleckner &lt;rnk@google.com&gt;</dc:creator>
    </item>
</channel>
</rss>
