curl / Mailing Lists / curl-library / Single Mail


Re: configure for ISO C90

From: Dan Fandrich <>
Date: Tue, 4 Apr 2017 06:46:46 +0200

On Mon, Apr 03, 2017 at 04:07:14PM +0000, Marcel Raad wrote:
> Thanks for the pointer. tst_compi_strdup seems incomplete. According to the documentation of AC_LANG_PROGRAM, it puts the second argument into a main function. Calling strdup inside a function works fine and only results in warnings. What doesn't work is referencing it at the file scope, which is what easy.c does:
> curl_strdup_callback Curl_cstrdup = (curl_strdup_callback)system_strdup;
> Probably noone tried to compile with -std=c90 yet, or they fixed curl_config.h manually.

I run autobuild with -std=iso9899:1990 (titled "…ANSI C89"), but they also set
-D_XOPEN_SOURCE=500. I don't remember precisely why I added the latter any
longer, but I think it was for exactly this reason, to ensure that strdup() is
made available since it's a requirement.

>>> Dan
Received on 2017-04-04