Opened 2 years ago

Closed 2 years ago

#44323 closed defect (fixed)

gnutls @3.3.5: support c89 (error: comma at end of enumerator list)

Reported by: ryandesign (Ryan Schmidt) Owned by: Schamschula (Marius Schamschula)
Priority: Normal Milestone:
Component: ports Version: 2.3.1
Keywords: haspatch Cc: egall@…
Port: gnutls

Description

Compiling gloox on Snow Leopard with its gcc-4.2 fails:

/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

It seems that having a comma at the end of an enumerator list is legal in c99 (which is the default for clang) but not with c89 (which is the default for gcc-4.2). So one fix would be to use c99. However, I think it's unreasonable to force all ports that want to use gnutls to switch to c99. Therefore I think gnutls should be fixed to support c89 again, as gnutls 3.1.x did before.

I'll work on a patch for this, and an upstream bug report for the developers.

Attachments (5)

gnutls.diff (697 bytes) - added by ryandesign (Ryan Schmidt) 2 years ago.
patch-lib-includes-gnutls-gnutls.h.in.diff (3.7 KB) - added by ryandesign (Ryan Schmidt) 2 years ago.
gnutls.2.diff (1.0 KB) - added by ryandesign (Ryan Schmidt) 2 years ago.
gnutls.3.diff (1.7 KB) - added by ryandesign (Ryan Schmidt) 2 years ago.
patch-c89.diff (6.1 KB) - added by ryandesign (Ryan Schmidt) 2 years ago.

Download all attachments as: .zip

Change History (14)

Changed 2 years ago by ryandesign (Ryan Schmidt)

comment:1 Changed 2 years ago by ryandesign (Ryan Schmidt)

Well, the attached patch is all that we should need to fix this. However the port fails to build now. Investigating...

comment:2 follow-ups: Changed 2 years ago by ryandesign (Ryan Schmidt)

It seems that patching gnutls.h.in causes the build system to think it should regenerate the documentation. And regenerating the documentation fails on OS X because its /usr/bin/sed is BSD sed. Although the configure script correctly finds /opt/local/bin/gsed, the documentation Makefile does not use the $SED variable and instead just uses the program name sed.

Since we've not made any changes to the file that would warrant regeneration of the documentation, and since regeneration of the documentation makes the build take twice as long, I'll try to suppress regenerating the documentation though fiddling with the timestamps.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 2 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign@…:

And regenerating the documentation fails on OS X because its /usr/bin/sed is BSD sed.

(For the record, it fails with BSD sed because they are using GNU-specific sed extensions, specifically that the argument to -i is optional, which it isn't under BSD sed.)

Changed 2 years ago by ryandesign (Ryan Schmidt)

Changed 2 years ago by ryandesign (Ryan Schmidt)

comment:4 in reply to: ↑ 2 Changed 2 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign@…:

I'll try to suppress regenerating the documentation though fiddling with the timestamps.

That works, but it turns out additional headers have the same issue. I'll try to find them all.

comment:5 Changed 2 years ago by egall@…

  • Cc egall@… added

Cc Me!

Changed 2 years ago by ryandesign (Ryan Schmidt)

Changed 2 years ago by ryandesign (Ryan Schmidt)

comment:6 follow-up: Changed 2 years ago by ryandesign (Ryan Schmidt)

  • Keywords haspatch added

This should now be all the needed patches. I still can't build gloox with apple-gcc-4.2, but the reason is now different, so I feel we can commit these gnutls fixes now.

comment:7 in reply to: ↑ description Changed 2 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign@…:

I'll work on a patch for this, and an upstream bug report for the developers.

Upstream bug report filed: https://savannah.gnu.org/support/index.php?108614

comment:8 in reply to: ↑ 3 Changed 2 years ago by ryandesign (Ryan Schmidt)

Replying to ryandesign@…:

(For the record, it fails with BSD sed because they are using GNU-specific sed extensions, specifically that the argument to -i is optional, which it isn't under BSD sed.)

Upstream bug report filed: https://savannah.gnu.org/support/index.php?108615

comment:9 in reply to: ↑ 6 Changed 2 years ago by ryandesign (Ryan Schmidt)

  • Resolution set to fixed
  • Status changed from new to closed

Replying to ryandesign@…:

This should now be all the needed patches. I still can't build gloox with apple-gcc-4.2, but the reason is now different, so I feel we can commit these gnutls fixes now.

r122082

Note: See TracTickets for help on using tickets.