Autodetection for strdup prototype fails

Create issue
Issue #1785 closed
Erik Schnetter created an issue

Cactus has autoconf code to detect whether there is a prototype for strdup. This autoconf code fails with icc, as icc never aborts when there are conflicting prototypes. There is a warning only.

I have disabled the respective autoconf macro and have commented out the respective lines in This code should either be corrected or removed.


Comments (7)

  1. Erik Schnetter reporter
    • removed comment

    Here is how to detect whether strdup has a prototype:


    This will fail unless strdup has a prototype.

  2. Roland Haas
    • removed comment

    already fixed (in more or less that way). The code now does:

     char *p = (char*)strdup;

    which is what autoconf 2.59's AC_CHECK_DECL does.

  3. Roland Haas
    • changed status to resolved
    • removed comment

    it no longer fails using either icc or gcc (tested on Datura and Debian). The test uses a method copied from autoconf 2.59. There is a leftover TODO which I am not sure I really would want to implement right now in that it just adds a new name for the same test. Currently configure output is a bit untidy in that it appears to check for strdup twice when in fact the first test checks for strdup in C and the second in C++.

  4. Erik Schnetter reporter
    • removed comment

    The TODO would make things easier to use since the user doesn't explicitly have to switch between C and C++ and back.

  5. Log in to comment