Bug 57352

Summary: Style Checker should prevent enums in bitfields
Product: WebKit Reporter: Levi Weintraub <leviw>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: brian.holt, commit-queue, dpranke, eric, glenn, levin, leviw, mrobinson, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Windows XP   
URL: http://rogerkarlsson.com/blogs/programming/enum-bit-field-visual-studio/
Attachments:
Description Flags
Patch none

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]
Patch
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]
Patch

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

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.