Bug 57352 - Style Checker should prevent enums in bitfields
Summary: Style Checker should prevent enums in bitfields
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL: http://rogerkarlsson.com/blogs/progra...
Depends on:
Reported: 2011-03-29 09:41 PDT by Levi Weintraub
Modified: 2014-07-12 17:31 PDT (History)
9 users (show)

See Also:

Patch (4.06 KB, patch)
2013-07-16 08:39 PDT, Brian Holt
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Levi Weintraub 2011-03-29 09:41:34 PDT
MSVC 8.0 has a bug where enums in bitfields are treated as signed, which causes the value when you read them back out to be incorrect (see description in link).

The style checker should prevent us from falling in this hole like I almost did.
Comment 1 Eric Seidel (no email) 2011-03-29 09:46:09 PDT
We (somewhat famously) hit this bug early during the Safari Win bringup.  Folks continue to hit it today.  Making check-webkit-style catch it would be nifty.
Comment 2 David Levin 2011-03-29 10:20:27 PDT
fwiw, the code is here: http://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/style/checkers/cpp.py

And I'm willing to give pointers (and reviews) to anyone who wants to add checks.
Comment 3 Brian Holt 2013-07-16 08:39:06 PDT
Created attachment 206786 [details]
Comment 4 Brian Holt 2013-08-29 08:20:47 PDT
Any thoughts on the patch? David would you be interested in reviewing it?
Comment 5 Darin Adler 2014-07-12 16:59:00 PDT
Comment on attachment 206786 [details]

Looks OK.
Comment 6 WebKit Commit Bot 2014-07-12 17:31:35 PDT
Comment on attachment 206786 [details]

Clearing flags on attachment: 206786

Committed r171038: <http://trac.webkit.org/changeset/171038>
Comment 7 WebKit Commit Bot 2014-07-12 17:31:40 PDT
All reviewed patches have been landed.  Closing bug.