Bug 21973 - gcc warnings in ASCIICType.h and Font.h
Summary: gcc warnings in ASCIICType.h and Font.h
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Trivial
Assignee: Nobody
Depends on:
Reported: 2008-10-30 10:02 PDT by Benjamin K. Stuhl
Modified: 2008-10-30 22:36 PDT (History)
0 users

See Also:

patch: add parentheses to disambiguate things (5.13 KB, patch)
2008-10-30 10:08 PDT, Benjamin K. Stuhl
mitz: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin K. Stuhl 2008-10-30 10:02:59 PDT
gcc 4.3.3 generates "suggest parentheses around && within ||" warnings when compiling JavaScriptCore/wtf/ASCIICType.h and WebCore/platform/graphics/Font.h

The code looks to be correct, just easy enough to mentally mis-parse that gcc warns about it with "build-webkit --qt"'s default compiler flags.
Comment 1 Benjamin K. Stuhl 2008-10-30 10:08:03 PDT
Created attachment 24773 [details]
patch: add parentheses to disambiguate things
Comment 2 Benjamin K. Stuhl 2008-10-30 10:09:34 PDT
Here's a patch to add disambiguating parentheses and quiet the warnings. It's my first patch to WebKit, so let me know what else I need to do.
Comment 3 mitz 2008-10-30 11:07:11 PDT
Comment on attachment 24773 [details]
patch: add parentheses to disambiguate things

r=me for these changes. I am not sure that as a rule this should be done everywhere where some compiler might suggest it.
Comment 4 Benjamin K. Stuhl 2008-10-30 13:11:06 PDT
Agreed, there may be places where just adding parentheses is not a great idea -- but getting a page of warnings from every file that includes ASCIICType.h isn't great either. Will you be landing the patch, then?
Comment 5 Timothy Hatcher 2008-10-30 22:36:44 PDT
Landed in r38024.