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

 
 

sr #108614: Reinstate support for C89

Submitter:  Ryan Carsten Schmidt <ryandesign>
Submitted:  Mon 14 Jul 2014 06:24:18 AM UTC
   
 
Category:  Core library Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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 Carsten 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 Carsten 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>
Group 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:


/opt/local/include/gnutls/gnutls.h:172: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:186: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:244: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:295: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:394: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:434: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:485: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:599: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:618: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:668: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:688: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:722: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:1598: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:1937: error: comma at end of enumerator list
/opt/local/include/gnutls/gnutls.h:2085: error: comma at end of enumerator list


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 Carsten Schmidt <ryandesign>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-20 nmav Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code