bug-autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking for memcpy


From: Mark Nudelman
Subject: Checking for memcpy
Date: Thu, 29 Mar 2007 13:21:42 -0700
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Hi,
I'm using autoconf 2.61 in the latest release of "less" and I've run
into a problem with checking for memcpy.  My configure.ac file contains
        AC_CHECK_FUNCS([fsync memcpy popen ...
and a bunch of other functions.

This is failing on SCO OpenServer 6.0.0 with the native cc compiler,
because the test code generates a call to memcpy with no parameters.
The compiler complains:

configure:6452: cc -o conftest -O -Kpthread   conftest.c -lgen  -lcurses >&5
UX:acomp: WARNING: "conftest.c", line 77: statement not reached
UX:acomp: ERROR: "conftest.c", line 75: no actual for asm formal: z

where the statement at line 75 is the call to memcpy in
| int
| main ()
| {
| return memcpy ();
|   ;
|   return 0;
| }

In the "Test Functions" section, the autoconf manual actually says:
-----------
If you include any header files, be sure to call the functions relevant
to them with the correct number of arguments, even if they are just 0,
to avoid compilation errors due to prototypes. GCC version 2 has
internal prototypes for several functions that it automatically inlines;
for example, memcpy. To avoid errors when checking for them, either pass
them the correct number of arguments or redeclare them with a different
return type (such as char).
-----------
but autoconf doesn't seem to take its own advice for the test functions
generated by AC_CHECK_FUNCS.

Is this a bug in autoconf, or am I using it incorrectly?  This worked in
previous versions of autoconf where the test function generated code
that merely took the address of the queried function rather than
actually calling it.

--Mark




reply via email to

[Prev in Thread] Current Thread [Next in Thread]