New Ticket     Tickets     Wiki     Browse Source     Timeline     Roadmap     Ticket Reports     Search

Ticket #44323 (closed defect: fixed)

Opened 12 months ago

Last modified 12 months ago

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

Reported by: ryandesign@… Owned by: mschamschula@…
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

gnutls.diff (697 bytes) - added by ryandesign@… 12 months ago.
patch-lib-includes-gnutls-gnutls.h.in.diff (3.7 KB) - added by ryandesign@… 12 months ago.
gnutls.2.diff (1.0 KB) - added by ryandesign@… 12 months ago.
gnutls.3.diff (1.7 KB) - added by ryandesign@… 12 months ago.
patch-c89.diff (6.1 KB) - added by ryandesign@… 12 months ago.

Change History

Changed 12 months ago by ryandesign@…

comment:1 Changed 12 months ago by ryandesign@…

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: ↓ 3 ↓ 4 Changed 12 months ago by ryandesign@…

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: ↓ 8 Changed 12 months ago by ryandesign@…

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 12 months ago by ryandesign@…

Changed 12 months ago by ryandesign@…

comment:4 in reply to: ↑ 2 Changed 12 months ago by ryandesign@…

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 12 months ago by egall@…

  • Cc egall@… added

Cc Me!

Changed 12 months ago by ryandesign@…

Changed 12 months ago by ryandesign@…

comment:6 follow-up: ↓ 9 Changed 12 months ago by ryandesign@…

  • 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 12 months ago by ryandesign@…

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 12 months ago by ryandesign@…

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 12 months ago by ryandesign@…

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

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.