<?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>144580</bug_id>
          
          <creation_ts>2015-05-04 09:39:16 -0700</creation_ts>
          <short_desc>[CMake] Build C code with -std=c89</short_desc>
          <delta_ts>2022-09-23 05:32:33 -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>New Bugs</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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="Zan Dobersek">zan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>gyuyoung.kim</cc>
    
    <cc>lantw44</cc>
    
    <cc>ossy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1091403</commentid>
    <comment_count>0</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2015-05-04 09:39:16 -0700</bug_when>
    <thetext>[CMake] Build C code with -std=c11</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1091406</commentid>
    <comment_count>1</comment_count>
      <attachid>252315</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2015-05-04 09:45:30 -0700</bug_when>
    <thetext>Created attachment 252315
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1091432</commentid>
    <comment_count>2</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-05-04 10:40:51 -0700</bug_when>
    <thetext>Let me check the EFL failure.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1091736</commentid>
    <comment_count>3</comment_count>
    <who name="Csaba Osztrogonác">ossy</who>
    <bug_when>2015-05-05 05:52:51 -0700</bug_when>
    <thetext>The problem is that strdup in string.h is ifdef-ed 
out if we build it with -std=c11. 

Defining GNU_SOURCE solves the build error in Minibrowser/main.c,
but I&apos;m not sure what is the proper fix for it, or if EFL wants
to build with c11 or not.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152194</commentid>
    <comment_count>4</comment_count>
      <attachid>252315</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-01-03 17:10:12 -0800</bug_when>
    <thetext>Comment on attachment 252315
Patch

I&apos;m not at all sure this is a good idea. Microsoft has no intention of supporting C11 (or even C99) in MSVCC, so we would have to be careful to only use C11 in code that will never be used by Windows. Since we probably want to support Windows eventually, allowing C11 to creep into our codebase anywhere will make that harder. It also makes it easier to accidentally break Windows when making changes locally, and not find out until the EWS catches it.

Now, with GCC 5 the default is currently -std=gnu11, so switching to -std=c11 is more restrictive as it disables GNU extensions, which is good for us. But with Clang the default is -std=gnu99, and with GCC 4.x the default is -std=gnu89. You might call Microsoft&apos;s version ms89. So we&apos;re compiling with four different standards right now, and there is certainly good benefit to explicitly specifying a standard. But I would suggest we explicitly compile with -std=c89, rather than c11.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152691</commentid>
    <comment_count>5</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-01-05 02:09:07 -0800</bug_when>
    <thetext>OK, agreed. Let&apos;s settle on c89 (in 2016 :|)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152692</commentid>
    <comment_count>6</comment_count>
      <attachid>268274</attachid>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-01-05 02:34:53 -0800</bug_when>
    <thetext>Created attachment 268274
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152701</commentid>
    <comment_count>7</comment_count>
      <attachid>268274</attachid>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2016-01-05 06:38:29 -0800</bug_when>
    <thetext>Comment on attachment 268274
Patch

Patch LGTM, except for the roughly bajillion EFL and GTK build failures. :/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1152713</commentid>
    <comment_count>8</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-01-05 07:36:01 -0800</bug_when>
    <thetext>The errors are in the Udis86 code. I&apos;m not fixing that since the code is coming from an external project, which I hope doesn&apos;t care about C89 compliance.

MSVC has some basic support for C99, and no compiler supports it completely anyway.

C11 doesn&apos;t work with EFL headers.

So either C99 should be default, or we should make the -std= C flag port-specific.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1155045</commentid>
    <comment_count>9</comment_count>
    <who name="Zan Dobersek">zan</who>
    <bug_when>2016-01-13 01:50:25 -0800</bug_when>
    <thetext>I&apos;m not bothering with this anymore. The amount of C code that&apos;s built is minimal, and every compiler and port have their own quirks around this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1900609</commentid>
    <comment_count>10</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-23 05:32:11 -0700</bug_when>
    <thetext>Is this required anymore? Thanks1</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>252315</attachid>
            <date>2015-05-04 09:45:30 -0700</date>
            <delta_ts>2016-01-05 02:34:47 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-144580-20150504094806.patch</filename>
            <type>text/plain</type>
            <size>1328</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">SW5kZXg6IENoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBDaGFuZ2VMb2cJKHJldmlzaW9uIDE4Mzc0
NykKKysrIENoYW5nZUxvZwkod29ya2luZyBjb3B5KQpAQCAtMSwzICsxLDE0IEBACisyMDE1LTA1
LTA0ICDFvWFuIERvYmVyxaFlayAgPHpkb2JlcnNla0BpZ2FsaWEuY29tPgorCisgICAgICAgIFtD
TWFrZV0gQnVpbGQgQyBjb2RlIHdpdGggLXN0ZD1jMTEKKyAgICAgICAgaHR0cHM6Ly9idWdzLndl
YmtpdC5vcmcvc2hvd19idWcuY2dpP2lkPTE0NDU4MAorCisgICAgICAgIFJldmlld2VkIGJ5IE5P
Qk9EWSAoT09QUyEpLgorCisgICAgICAgICogU291cmNlL2NtYWtlL09wdGlvbnNDb21tb24uY21h
a2U6IEFwcGVuZCB0aGUgLXN0ZD1jMTEgZmxhZworICAgICAgICB0byBDTUFLRV9DX0ZMQUdTLCBl
bmZvcmNpbmcgYnVpbGRpbmcgdGhlIEMgY29kZSBpbiB0aGUgV2ViS2l0CisgICAgICAgIHByb2pl
Y3QgaW4gQzExIHN0YW5kYXJkIG1vZGUuCisKIDIwMTUtMDUtMDQgIENzYWJhIE9zenRyb2dvbsOh
YyAgPG9zc3lAd2Via2l0Lm9yZz4KIAogICAgICAgICBbY21ha2VdIERpc2FibGUgR05VIEdvbGQg
bGlua2VyIG9uIENvcnRleCBBNTMKSW5kZXg6IFNvdXJjZS9jbWFrZS9PcHRpb25zQ29tbW9uLmNt
YWtlCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT0KLS0tIFNvdXJjZS9jbWFrZS9PcHRpb25zQ29tbW9uLmNtYWtlCShyZXZp
c2lvbiAxODM3NDQpCisrKyBTb3VyY2UvY21ha2UvT3B0aW9uc0NvbW1vbi5jbWFrZQkod29ya2lu
ZyBjb3B5KQpAQCAtMjYsNiArMjYsNyBAQCBzZXRfcHJvcGVydHkoR0xPQkFMIFBST1BFUlRZIFVT
RV9GT0xERVJTCiAKIGlmIChDTUFLRV9DT01QSUxFUl9JU19HTlVDWFggT1IgIiR7Q01BS0VfQ1hY
X0NPTVBJTEVSX0lEfSIgU1RSRVFVQUwgIkNsYW5nIikKICAgICBzZXQoQ01BS0VfQ19GTEFHU19S
RUxFQVNFICIke0NNQUtFX0NfRkxBR1NfUkVMRUFTRX0gLWZuby1leGNlcHRpb25zIC1mbm8tc3Ry
aWN0LWFsaWFzaW5nIikKKyAgICBzZXQoQ01BS0VfQ19GTEFHUyAiJHtDTUFLRV9DX0ZMQUdTfSAt
c3RkPWMxMSIpCiAgICAgc2V0KENNQUtFX0NYWF9GTEFHU19SRUxFQVNFICIke0NNQUtFX0NYWF9G
TEFHU19SRUxFQVNFfSAtZm5vLWV4Y2VwdGlvbnMgLWZuby1zdHJpY3QtYWxpYXNpbmcgLWZuby1y
dHRpIikKICAgICBzZXQoQ01BS0VfQ1hYX0ZMQUdTICIke0NNQUtFX0NYWF9GTEFHU30gLXN0ZD1j
KysxMSIpCiBlbmRpZiAoKQo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>268274</attachid>
            <date>2016-01-05 02:34:53 -0800</date>
            <delta_ts>2016-01-05 06:38:29 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-144580-20160105023419.patch</filename>
            <type>text/plain</type>
            <size>1585</size>
            <attacher name="Zan Dobersek">zan</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTk0NTgwCmRpZmYgLS1naXQgYS9Tb3VyY2UvY21ha2UvT3B0
aW9uc0NvbW1vbi5jbWFrZSBiL1NvdXJjZS9jbWFrZS9PcHRpb25zQ29tbW9uLmNtYWtlCmluZGV4
IDMzOWM1N2JiODAyNDVkMTM3ZjFjNjg4ZjI0ZjBmZDEwZGQxNTgzZGQuL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AQAorMjAxNi0wMS0wNSAgWmFuIERvYmVyc2VrICA8emRvYmVyc2Vr
QGlnYWxpYS5jb20+CisKKyAgICAgICAgW0NNYWtlXSBCdWlsZCBDIGNvZGUgd2l0aCAtc3RkPWM4
OQorICAgICAgICBodHRwczovL2J1Z3Mud2Via2l0Lm9yZy9zaG93X2J1Zy5jZ2k/aWQ9MTQ0NTgw
CisKKyAgICAgICAgUmV2aWV3ZWQgYnkgTk9CT0RZIChPT1BTISkuCisKKyAgICAgICAgKiBTb3Vy
Y2UvY21ha2UvT3B0aW9uc0NvbW1vbi5jbWFrZTogQXBwZW5kIHRoZSAtc3RkPWM4OSBmbGFnCisg
ICAgICAgIHRvIENNQUtFX0NfRkxBR1MsIGVuZm9yY2luZyBidWlsZGluZyB0aGUgQyBjb2RlIGlu
IHRoZSBXZWJLaXQKKyAgICAgICAgcHJvamVjdCBpbiBDODkgc3RhbmRhcmQgbW9kZS4gVGhpcyBt
b2RlIHNob3VsZCBiZSB3ZWxsIHN1cHBvcnRlZAorICAgICAgICBieSBhbGwgdGhlIGN1cnJlbnQg
YW5kIGZ1dHVyZSBjb21waWxlcnMgdGhhdCB3ZSB3b3VsZCBiZSB1c2luZy4KKyAgICAgICAgQzEx
IG1vZGUgd291bGQgYmUgcHJlZmVycmVkLCBidXQgTVNWQyBkb2Vzbid0IHN1cHBvcnQgaXQuCisK
IDIwMTYtMDEtMDQgIEFsZXggQ2hyaXN0ZW5zZW4gIDxhY2hyaXN0ZW5zZW5Ad2Via2l0Lm9yZz4K
IAogICAgICAgICBGaXggTWFjIENNYWtlIGJ1aWxkIGFmdGVyIHIxOTQ0NTQuCg==
</data>
<flag name="review"
          id="293221"
          type_id="1"
          status="-"
          setter="mcatanzaro"
    />
          </attachment>
      

    </bug>

</bugzilla>