NEW 134252
check-webkit-style should warn about signed values in bit fields
https://bugs.webkit.org/show_bug.cgi?id=134252
Summary check-webkit-style should warn about signed values in bit fields
Brent Fulgham
Reported 2014-06-24 09:36:06 PDT
MSVC backs its enumerated types as signed values. This causes problems when enums are used as elements in a bit field, because MSVC wants to include a sign bit in the encoding. This means we loose one bit of resolution, often causing incorrect behavior. See Bug 134237 for some details on this problem. Because of this, 'check-webkit-style' should warn when a developer attempts to insert an enum or other potentially signed value in a bit field. Should be rejected: SendCallbackPolicy sendLoadCallbacks : 1; ContentSniffingPolicy sniffContent : 1; DataBufferingPolicy dataBufferingPolicy : 1; Should be allowed: unsigned sendLoadCallbacks : 1; bool sniffContent : 1; unsigned dataBufferingPolicy : 1;
Attachments
Note You need to log in before you can comment on or make changes to this bug.