Reputation: 5393
In an autoconf script I have:
AC_CHECK_FUNC([asprintf],
[CONFIGFLAGS+=" -DCB_HAVE_ASPRINTF"],
[]
)
And this passes, thus defining CB_HAVE_ASPRINTF
. But without defining _GNU_SOURCE
the makefile will fail, so it is incorrect for the configure script to pass this function. What is wrong with it?
This problem is occurring on Linux Mint 13.
Upvotes: 0
Views: 87
Reputation: 4517
AC_CHECK_FUNC[S]
only does link-time checks, it doesn't check the headers.
Also, it's documented as being a GNU extension, so you should only try to use it if you defined _GNU_SOURCE
before the includes or in the command-line.
Upvotes: 1