Opened 6 years ago

Closed 6 years ago

#55433 closed defect (fixed)

glib2 @2.54.2 +quartz: error: ‘for’ loop initial declaration used outside C99 mode

Reported by: pkoshevoy (Pavel Koshevoy) Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: tiger leopard snowleopard Cc:
Port: glib2

Description

: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'

Attachments (1)

main.log (577.4 KB) - added by pkoshevoy (Pavel Koshevoy) 6 years ago.

Download all attachments as: .zip

Change History (4)

Changed 6 years ago by pkoshevoy (Pavel Koshevoy)

Attachment: main.log added

comment:1 Changed 6 years ago by mf2k (Frank Schima)

Cc: ryandesign removed
Owner: set to ryandesign
Status: newassigned

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

Keywords: tiger leopard added
Summary: glib2 2.54.2_0 -universal -x11: build error on osx 10.6glib2 @2.54.2 +quartz: error: ‘for’ loop initial declaration used outside C99 mode

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.

comment:3 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In acd6f2b3aaa888b31e183ab6ea178a7c53977de9/macports-ports:

glib2: Fix crash and build failure with +quartz

Closes: #55433

Note: See TracTickets for help on using tickets.