helpGnuTLS - Support: sr #108614, Reinstate support for C89

 
 

sr #108614: Reinstate support for C89

Submitted by:  Ryan Schmidt <ryandesign>
Submitted on:  Mon 14 Jul 2014 06:24:18 AM UTC  
 
Category: Core libraryPriority: 5 - Normal
Severity: 3 - NormalStatus: None
Privacy: PublicAssigned to: None
Open/Closed: ClosedOperating System: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Fri 19 Sep 2014 01:17:54 AM UTC, comment #3:

It looks like you did apply this patch:

https://gitorious.org/gnutls/gnutls/commit/0345118a91ac776671cdf6c907164c75ac3559f1

Thanks! So this ticket can be closed.

While C99 may be 15 years old, C89 is the default mode of the gcc 4.2.1 compiler, which is the default compiler on OS X 10.6, which was released by Apple just 5 years ago in August 2009 and was not replaced by OS X 10.7 until July 2011. According to one company's survey just 6 weeks ago (https://chitika.com/insights/2014/yosemite-preview-adoption) OS X 10.6 remains the second most popular version of OS X with 17.5% market share, behind OS X 10.9 with 45.7%. So it is important to continue to support users using OS X 10.6 and its older compiler.

Ryan Schmidt <ryandesign>
Sun 27 Jul 2014 12:35:13 PM UTC, comment #2:

The text version is available via the link "Original Format" at the bottom of the page, or directly at:

https://trac.macports.org/raw-attachment/ticket/44323/patch-c89.diff

Ryan Schmidt <ryandesign>
Sun 27 Jul 2014 12:21:08 PM UTC, comment #1:

Hello,
I could apply the patch if you attach it in a text format (the link you sent is in html format). Nevertheless, C99 is already 15 years old and I'll not spent much resources in keeping the code C89-compliant, except maybe for headers, as your patch does.

Nikos Mavrogiannopoulos <nmav>
Project Administrator
Mon 14 Jul 2014 06:24:18 AM UTC, original submission:

Hello, I'm with the MacPorts package management system, which recently updated its gnutls package from version 3.1.x to 3.3.5. We've found that now, software that uses gnutls cannot be compiled in c89 mode because of errors like this:

For more info, see:

https://trac.macports.org/ticket/44323

These problems are not seen in c99 mode, where a comma at the end of an enumerator list is legal.

c99 mode is used by default by clang, which is included in the developer tools on Mac OS X v10.6 and later. However, c89 is used by default by the old versions of gcc included in the developer tools on Mac OS X v10.6 and earlier, and that's also the default compiler there.

One could say "well, just build in c99 mode", but I feel that's an onerous requirement to place on every software package that uses gnutls. Therefore, to better support earlier Mac OS X versions, I propose you remove the commas at the end of your enumerator lists. I made this patch to do this, and it seems to work:

https://trac.macports.org/attachment/ticket/44323/patch-c89.diff

Ryan Schmidt <ryandesign>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by nmav (Posted a comment)
  • -unavailable- added by ryandesign (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 20 Sep 2014 11:22:11 PM UTCnmavOpen/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup