Re: [MacPorts] #55433: glib2 @2.54.2 +quartz: error: ‘for’ loop initial declaration used outside C99 mode (was: glib2 2.54.2_0 -universal -x11: build error on osx 10.6)
MacPorts
noreply at macports.org
Thu Nov 30 05:53:27 UTC 2017
#55433: glib2 @2.54.2 +quartz: error: ‘for’ loop initial declaration used outside
C99 mode
------------------------+---------------------------------------
Reporter: pkoshevoy | Owner: ryandesign
Type: defect | Status: assigned
Priority: Normal | Milestone:
Component: ports | Version: 2.4.2
Resolution: | Keywords: tiger leopard snowleopard
Port: glib2 |
------------------------+---------------------------------------
Changes (by ryandesign):
* keywords: snowleopard => tiger leopard snowleopard
Comment:
The basic explanation is that this code declares a variable inside a `for`
loop. That's allowed in C99 mode which is the default in clang which is
used on Lion and later, but is not legal in C89 mode which is the default
in gcc-4.2 which is used on Snow Leopard and earlier.
It's easy enough to make the code C89 compatible by moving the variable
declaration to the top of the function. But it turns out this code also
[https://bugzilla.gnome.org/show_bug.cgi?id=789784 caused crashes] and was
already
[https://github.com/GNOME/glib/commit/d74a69826ffc5591a7eeea61ca25f66f48fcf939
reverted]. So I should probably add a patch to revert it in MacPorts too.
This only affects glib2 @2.54.2 with the +quartz variant. The +x11 variant
is not affected and neither is glib2-devel @2.55.0.
--
Ticket URL: <https://trac.macports.org/ticket/55433#comment:2>
MacPorts <https://www.macports.org/>
Ports system for macOS
More information about the macports-tickets
mailing list