glib2 @2.54.2 +quartz: error: ‘for’ loop initial declaration used outside C99 mode
:info:build libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I.. -I/opt/local/include -DG_LOG_DOMAIN=\"GLib-GIO\" -I.. -I../glib -I../glib -I.. -I../gmodule -DG_DISABLE_CAST_CHECKS -DGIO_COMPILATION -DGIO_MODULE_DIR=\"/opt/local/lib/gio/modules\" -I/opt/local/include -D_R
EENTRANT -fvisibility=hidden -xobjective-c -pipe -Os -fstrict-aliasing -arch x86_64 -MT libgio_2_0_la-gosxcontenttype.lo -MD -MP -MF .deps/libgio_2_0_la-gosxcontenttype.Tpo -c gosxcontenttype.c -fno-common -DPIC -o .libs/libgio_2_0_la-gosxcontenttype.o
:info:build gosxappinfo.c: In function ‘create_cstr_from_cfstring’:
:info:build gosxappinfo.c:202: error: ‘for’ loop initial declaration used outside C99 mode
:info:build make[4]: *** [libgio_2_0_la-gosxappinfo.lo] Error 1
:info:build make[4]: *** Waiting for unfinished jobs....
:info:build gosxcontenttype.c: In function ‘create_cstr_from_cfstring’:
:info:build gosxcontenttype.c:80: error: ‘for’ loop initial declaration used outside C99 mode
:info:build make[4]: *** [libgio_2_0_la-gosxcontenttype.lo] Error 1
:info:build make[4]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_glib2/glib2/work/glib-2.54.2/gio'
Change History (4)
Cc: |
ryandesign removed
|
Owner: |
set to ryandesign
|
Status: |
new →
assigned
|
Keywords: |
tiger leopard added
|
Summary: |
glib2 2.54.2_0 -universal -x11: build error on osx 10.6 →
glib2 @2.54.2 +quartz: error: ‘for’ loop initial declaration used outside C99 mode
|
Resolution: |
→ fixed
|
Status: |
assigned →
closed
|
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 caused crashes and was already 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.