Bug 134252
| Summary: | check-webkit-style should warn about signed values in bit fields | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Brent Fulgham <bfulgham> |
| Component: | Tools / Tests | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | ap, joepeck |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Brent Fulgham
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |