Opened 10 years ago
Closed 10 years ago
#44323 closed defect (fixed)
gnutls @3.3.5: support c89 (error: comma at end of enumerator list)
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | Schamschula (Marius Schamschula) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 2.3.1 |
Keywords: | haspatch | Cc: | cooljeanius (Eric Gallager) |
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)
Change History (14)
Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | gnutls.diff added |
---|
comment:1 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
comment:2 follow-ups: 3 4 Changed 10 years ago by ryandesign (Ryan Carsten 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 follow-up: 8 Changed 10 years ago by ryandesign (Ryan Carsten 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 10 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | patch-lib-includes-gnutls-gnutls.h.in.diff added |
---|
Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | gnutls.2.diff added |
---|
comment:4 Changed 10 years ago by ryandesign (Ryan Carsten 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.
Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | gnutls.3.diff added |
---|
Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Attachment: | patch-c89.diff added |
---|
comment:6 follow-up: 9 Changed 10 years ago by ryandesign (Ryan Carsten 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 Changed 10 years ago by ryandesign (Ryan Carsten 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 Changed 10 years ago by ryandesign (Ryan Carsten 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 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | new → 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.
Well, the attached patch is all that we should need to fix this. However the port fails to build now. Investigating...