Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#60550 closed defect (fixed)

c-ares @1.16.1 does not build on PPC Tiger, Mac OS X 10.4.11, because "'for' loop initial declaration used outside C99 mode"

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: tobypeterson
Priority: Normal Milestone:
Component: ports Version: 2.6.2
Keywords: tiger Cc:
Port: c-ares

Description

  CC       libcares_la-ares_getnameinfo.lo
  CC       libcares_la-ares_getsock.lo
  CC       libcares_la-ares_init.lo
ares_init.c: In function 'init_by_resolv_conf':
ares_init.c:1614: error: 'for' loop initial declaration used outside C99 mode
ares_init.c:1643: error: 'for' loop initial declaration used outside C99 mode
make[2]: *** [libcares_la-ares_init.lo] Error 1
make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_nue.de.rsync.macports.org_macports_release_tarballs_ports_net_c-ares/c-ares/work/c-ares-1.16.1'
make[1]: *** [all-recursive] Error 1

Attachments (1)

main.log (42.8 KB) - added by ballapete (Peter "Pete" Dyballa) 4 years ago.
Main.log from PPC Tiger

Download all attachments as: .zip

Change History (9)

Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: main.log added

Main.log from PPC Tiger

comment:1 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

configure reports:

configure: No compiler with C++11 support was found

so it might be recommended to use GCC 7 or such.

comment:2 Changed 4 years ago by mf2k (Frank Schima)

Cc: toby@… removed
Keywords: tiger added; Tiger removed
Owner: set to tobypeterson
Status: newassigned

comment:3 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

It worked to put the line

configure.cflags-append -std=c99

into Portfile. Applying this change on the command line failed. The above mentioned warning was reported again.

comment:4 Changed 4 years ago by tobypeterson

The code in question hasn't changed, but it appears that there was a configuration change that now causes it to be built. From CHANGES: "MacOS: Enable libresolv support for retrieving DNS servers like iOS does."

comment:5 Changed 4 years ago by tobypeterson

Resolution: fixed
Status: assignedclosed

In 5766b81f3b4df47e18b5d6b46982cb6438d0662c/macports-ports (master):

c-ares: build with non-C99 compilers, fixes #60550

comment:6 Changed 4 years ago by tobypeterson

I opted to patch out the C99-ism; seems less risky than changing the -std version for everyone.

comment:7 in reply to:  3 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ballapete:

It worked to put the line

configure.cflags-append -std=c99

into Portfile. Applying this change on the command line failed. The above mentioned warning was reported again.

That's correct. MacPorts does not support for appending to, deleting from, or otherwise modifying portfile variables from the command line. It only supports overwriting them entirely, which can be used as a diagnostic tool.

Replying to tobypeterson:

I opted to patch out the C99-ism; seems less risky than changing the -std version for everyone.

That's fine but note that clang has always defaulted to c99 mode so the only thing that setting -std=c99 would change would be to fix the build failure with Apple's old gcc that defaulted to c89. If upstream adopts more c99isms such that patching them out becomes cumbersome, it wouldn't be terrible to force c99 mode, since older compilers do support that. We've done it in several other ports before.

comment:8 Changed 4 years ago by tobypeterson

Sure, forcing C99 probably isn’t a big deal. However, I suspect the approach I’ve taken is what upstream would do anyway - the project as a whole has no other usage of C99 features.

Note: See TracTickets for help on using tickets.