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: Zan Lynx <zlynx_at_acm.org>
Date: Fri, 17 Jul 2020 22:59:01 -0600

On 7/17/2020 10:07 PM, Jeffrey Walton 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
>
> Jeff
>

I believe that compiler is too old to default to C99. You might make
this work by specifying the compiler standard in the CFLAGS. Try
"-std=c99" or "-std=gnu99"

-- 
                 Knowledge is Power -- Power Corrupts
                         Study Hard -- Be Evil
Received on 2020-07-18