<html>
    <head>
      <base href="https://bugs.webkit.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Macro expansion producing 'defined' has undefined behavior"
   href="https://bugs.webkit.org/show_bug.cgi?id=166047">166047</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Macro expansion producing 'defined' has undefined behavior
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>WebKit
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>WebKit Nightly Build
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>macOS 10.12
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>Minor
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P2
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>JavaScriptCore
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>webkit-unassigned&#64;lists.webkit.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ttsugrii&#64;fb.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>When compiling JSC with master build of clang, I get many errors (warnings which are treated as errors) like:
/tmp/WebKit/Source/JavaScriptCore/API/JSBase.h:141:122: note: expanded from macro 'JSC_OBJC_API_ENABLED'
#define JSC_OBJC_API_ENABLED (defined(__clang__) &amp;&amp; defined(__APPLE__) &amp;&amp; ((defined(__MAC_OS_X_VERSION_MIN_REQUIRED) &amp;&amp; !defined(__i386__)) || (defined(TARGET_OS_IPHONE) &amp;&amp; TARGET_OS_IPHONE)))
                                                                                                                         ^
In file included from /tmp/WebKit/Source/JavaScriptCore/testRegExp.cpp:26:

/tmp/WebKit/Source/JavaScriptCore/runtime/JSGlobalObject.h:594:5: error: macro expansion producing 'defined' has undefined behavior [-Werror,-Wexpansion-to-defined]

The fix is trivial - instead of checks like #if FOO, #if FOO == 1 has to be used and instead of #define FOO (...), #if (...) #define FOO = 1 #else #define FOO = 0 #endif should be used.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>