[Webkit-unassigned] [Bug 65401] Weird macros for use in "#if" in Platform.h

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jul 29 17:29:16 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=65401





--- Comment #1 from Darin Adler <darin at apple.com>  2011-07-29 17:29:16 PST ---
(In reply to comment #0)
> 1. Why is it harmful? The C++ spec says at 16.1p4 "If the token 'defined' is generated as a result of this replacement process ..., the behavior is undefined.". That's what's happening here.

Interesting. I did not know that.

> 2. Why is it not needed? Because "#if" replaces any unknown macros by "0". And the macro already relies on this to happen. If it wouldn't happen, the "&& WTF_PLATFORM_##WTF_FEATURE" would be broken if the macro doesn't exist.

It is needed because compilers like gcc have a mode where they warn if “unknown” macros are used. We want to be able to compile with such warnings turned on.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list