<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>172618</bug_id>
          
          <creation_ts>2017-05-25 16:06:49 -0700</creation_ts>
          <short_desc>Building with GCC 7.1.x spews lots of “warning: this use of &quot;defined&quot; may not be portable [-Wexpansion-to-defined]“</short_desc>
          <delta_ts>2017-05-25 20:12:17 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>Other</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>167643</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adrian Perez">aperez</reporter>
          <assigned_to name="Adrian Perez">aperez</assigned_to>
          <cc>achristensen</cc>
    
    <cc>lforschler</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1312938</commentid>
    <comment_count>0</comment_count>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2017-05-25 16:06:49 -0700</bug_when>
    <thetext>This happens for all the expansions of:

  - #if ENABLE(FOO)
  - #if PLATFORM(FOO)
  - #if CPU(FOO)
  - #if USE(FOO)
  - #if HAVE(FOO)
  - ...

For example:

  ../../Source/WTF/wtf/Platform.h:807:1: warning: this use of &quot;defined&quot; may not be portable [-Wexpansion-to-defined]
  #if (CPU(X86_64) || CPU(ARM64)) &amp;&amp; HAVE(FAST_TLS)
     ^~~~~~~~~~~~~                          

It seems that the -Wexpansion-to-defined existed before in GCC, but the warning
is now enabled by default in version 7.1.x of the compiler. WebKit source code
makes extensive use of this kind of expansions, so probably it&apos;d be better to
silence these warnings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1312940</commentid>
    <comment_count>1</comment_count>
      <attachid>311307</attachid>
    <who name="Adrian Perez">aperez</who>
    <bug_when>2017-05-25 16:10:42 -0700</bug_when>
    <thetext>Created attachment 311307
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1313015</commentid>
    <comment_count>2</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-05-25 19:57:32 -0700</bug_when>
    <thetext>I know you already have a patch here and normally I&apos;d favor the bug with the patch, but there&apos;s good discussion in bug #167643 so please reattach it there.

My concern is that these macros are all undefined behavior, so we should consider eliminating them.

*** This bug has been marked as a duplicate of bug 167643 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1313017</commentid>
    <comment_count>3</comment_count>
      <attachid>311307</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2017-05-25 20:12:17 -0700</bug_when>
    <thetext>Comment on attachment 311307
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=311307&amp;action=review

&gt; Source/cmake/OptionsCommon.cmake:78
&gt; +   if (CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL &quot;7.1.0&quot;)
&gt; +     set(CMAKE_C_FLAGS &quot;${CMAKE_C_FLAGS} -Wno-expansion-to-defined&quot;)
&gt; +   endif ()

No need to check compiler version, just enable it unconditionally. Look for wherever our other warning flags are used; we probably don&apos;t need to add a new line, just add it to wherever the other ones are.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>311307</attachid>
            <date>2017-05-25 16:10:42 -0700</date>
            <delta_ts>2017-05-25 19:57:40 -0700</delta_ts>
            <desc>Patch</desc>
            <filename>bug-172618-20170526011040.patch</filename>
            <type>text/plain</type>
            <size>1921</size>
            <attacher name="Adrian Perez">aperez</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMjE3NDU1CmRpZmYgLS1naXQgYS9Tb3VyY2UvY21ha2UvT3B0
aW9uc0NvbW1vbi5jbWFrZSBiL1NvdXJjZS9jbWFrZS9PcHRpb25zQ29tbW9uLmNtYWtlCmluZGV4
IGU3N2M3MDc2Zjg1NWMzOGFhNmUzMTliZTczODZhM2JkNWE1ZmRiOTcuLjA4ZGFlMDk0ZGNlZjc0
ZDRkZGNhNjIxNjE5MWU0YTYxMTgxNGYyNzIgMTAwNjQ0Ci0tLSBhL1NvdXJjZS9jbWFrZS9PcHRp
b25zQ29tbW9uLmNtYWtlCisrKyBiL1NvdXJjZS9jbWFrZS9PcHRpb25zQ29tbW9uLmNtYWtlCkBA
IC03MywxMSArNzMsMTcgQEAgZW5kbWFjcm8oKQogaWYgKENNQUtFX0NPTVBJTEVSX0lTX0dOVUND
KQogICAgREVURVJNSU5FX0dDQ19TWVNURU1fSU5DTFVERV9ESVJTKCJjIiAiJHtDTUFLRV9DX0NP
TVBJTEVSfSIgIiR7Q01BS0VfQ19GTEFHU30iIFNZU1RFTV9JTkNMVURFX0RJUlMpCiAgICBzZXQo
Q01BS0VfQ19JTVBMSUNJVF9JTkNMVURFX0RJUkVDVE9SSUVTICR7Q01BS0VfQ19JTVBMSUNJVF9J
TkNMVURFX0RJUkVDVE9SSUVTfSAke1NZU1RFTV9JTkNMVURFX0RJUlN9KQorICAgaWYgKENNQUtF
X0NfQ09NUElMRVJfVkVSU0lPTiBWRVJTSU9OX0dSRUFURVJfRVFVQUwgIjcuMS4wIikKKyAgICAg
c2V0KENNQUtFX0NfRkxBR1MgIiR7Q01BS0VfQ19GTEFHU30gLVduby1leHBhbnNpb24tdG8tZGVm
aW5lZCIpCisgICBlbmRp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