Bug 128301 - Misused PLATFORM(MIDDLE_ENDIAN) and PLATFORM(BIG_ENDIAN)
Summary: Misused PLATFORM(MIDDLE_ENDIAN) and PLATFORM(BIG_ENDIAN)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-06 02:50 PST by Tamas Gergely
Modified: 2014-06-18 00:00 PDT (History)
5 users (show)

See Also:


Attachments
patch (1.37 KB, patch)
2014-02-06 02:51 PST, Tamas Gergely
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tamas Gergely 2014-02-06 02:50:09 PST
MIDDLE_ENDIAN and BIG_ENDIAN are CPU attributes and not platform. They should be used with CPU() macro, and not with PLATFORM().
Comment 1 Tamas Gergely 2014-02-06 02:51:53 PST
Created attachment 223320 [details]
patch
Comment 2 Daniel Bates 2014-06-17 14:59:41 PDT
Comment on attachment 223320 [details]
patch

r=me

Is there any way we can prevent this? From briefly searching, GCC has option -Wundef to warn about undefined identifiers. Would enabling it lead to many false positives?
Comment 3 WebKit Commit Bot 2014-06-17 15:35:54 PDT
Comment on attachment 223320 [details]
patch

Clearing flags on attachment: 223320

Committed r170081: <http://trac.webkit.org/changeset/170081>
Comment 4 WebKit Commit Bot 2014-06-17 15:35:57 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Csaba Osztrogonác 2014-06-18 00:00:05 PDT
(In reply to comment #2)
> (From update of attachment 223320 [details])
> r=me
> 
> Is there any way we can prevent this? From briefly searching, GCC has option -Wundef to warn about undefined identifiers. Would enabling it lead to many false positives?

-Wundef is used by EFL port, but it doesn't help similar issues,
because PLATFORM macro has the following definition:

#define PLATFORM(WTF_FEATURE) (defined WTF_PLATFORM_##WTF_FEATURE  && WTF_PLATFORM_##WTF_FEATURE)