Subject: Re: ares_init.c:1614: error: 'for' loop initial declaration used outside C99 mode

Re: ares_init.c:1614: error: 'for' loop initial declaration used outside C99 mode

From: Jeffrey Walton <noloader_at_gmail.com>
Date: Sat, 18 Jul 2020 00:29:18 -0400

On Sat, Jul 18, 2020 at 12:07 AM Jeffrey Walton <noloader_at_gmail.com> wrote:
>
> Hi Everyone,
>
> I'm building c-ares-1.16.1 on an antique PowerMac G5. The machine has
> GCC 4.0.1. I'm catching a compile error:
>
> libtool: compile: gcc -DHAVE_CONFIG_H -I. -I.
> -DCARES_BUILDING_LIBRARY -DCARES_SYMBOL_HIDING -isystem
> /usr/local/include -DNDEBUG -fvisibility=hidden -O2 -mlong-double-64
> -fPIC -pthread -g0 -Wno-system-headers -MT
> libcares_la-ares_library_init.lo -MD -MP -MF
> .deps/libcares_la-ares_library_init.Tpo -c ares_library_init.c
> -fno-common -DPIC -o .libs/libcares_la-ares_library_init.o
> 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

This patch tested OK.

Jeff

Received on 2020-07-18