Bug 21973

Summary: gcc warnings in ASCIICType.h and Font.h
Product: WebKit Reporter: Benjamin K. Stuhl <bks24>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Trivial    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: PC   
OS: Linux   
Attachments:
Description Flags
patch: add parentheses to disambiguate things mitz: review+

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.