On Mon, 3 Apr 2017, Marcel Raad wrote:

I know very little about Autotools and I'm trying to configure curl for ISO C90 using GCC with ./configure --enable-warnings CFLAGS="-std=c90" so that I can be sure to not rely on C99-isms.

I would strongly recommend using "./configure --enable-debug" instead. Simpler to write, adds many more pendantic compiler options and runs 'make checksrc' by default on the code etc.

conftest.c:274:9: warning: implicit declaration of function 'strdup' [-Wimplicit-function-declaration]

conftest.c:274:9: warning: nested extern declaration of 'strdup' [-Wnested-externs]

It seems like --disable-werror is used for the configure tests, so the warnings are ignored even if I explicitly specify --enable-werror and e.g. HAVE_STRDUP is set to 1 even though strdup is not usable: easy.c:160:23: error: 'strdup' undeclared here (not in a function)

When configure runs tests to check for functions and features they whould work independent of what extra flags you set.

If the configure check wrongly detects your strdup as present when it is fact isn't, then CURL_CHECK_FUNC_STRDUP in m4/curl-functions.m4 is bad. Which is surprising to me since it has been around unmodified for a very long time now.

The test seems rather complete to me...

  AC_MSG_CHECKING([if strdup might be used])
  if test "$tst_links_strdup" = "yes" &&
     test "$tst_proto_strdup" = "yes" &&
     test "$tst_compi_strdup" = "yes" &&
     test "$tst_allow_strdup" = "yes"; then
    AC_MSG_RESULT([yes])
    AC_DEFINE_UNQUOTED(HAVE_STRDUP, 1,
      [Define to 1 if you have the strdup function.])
    curl_cv_func_strdup="yes"
  else
    AC_MSG_RESULT([no])
    curl_cv_func_strdup="no"

--

 / daniel.haxx.se
-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to