mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
configure: check if compiler halts on function prototype mismatch
This commit is contained in:
parent
f6af9d9886
commit
57fa576a35
@ -340,6 +340,7 @@ fi
|
|||||||
|
|
||||||
CURL_CHECK_COMPILER_HALT_ON_ERROR
|
CURL_CHECK_COMPILER_HALT_ON_ERROR
|
||||||
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
CURL_CHECK_COMPILER_ARRAY_SIZE_NEGATIVE
|
||||||
|
CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
|
||||||
CURL_CHECK_COMPILER_SYMBOL_HIDING
|
CURL_CHECK_COMPILER_SYMBOL_HIDING
|
||||||
|
|
||||||
CURL_CHECK_NO_UNDEFINED
|
CURL_CHECK_NO_UNDEFINED
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#***************************************************************************
|
#***************************************************************************
|
||||||
|
|
||||||
# File version for 'aclocal' use. Keep it a single number.
|
# File version for 'aclocal' use. Keep it a single number.
|
||||||
# serial 63
|
# serial 64
|
||||||
|
|
||||||
|
|
||||||
dnl CURL_CHECK_COMPILER
|
dnl CURL_CHECK_COMPILER
|
||||||
@ -1495,6 +1495,42 @@ AC_DEFUN([CURL_CHECK_COMPILER_SYMBOL_HIDING], [
|
|||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
|
dnl CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH
|
||||||
|
dnl -------------------------------------------------
|
||||||
|
dnl Verifies if the compiler actually halts after the
|
||||||
|
dnl compilation phase without generating any object
|
||||||
|
dnl code file, when the source code tries to redefine
|
||||||
|
dnl a prototype which does not match previous one.
|
||||||
|
|
||||||
|
AC_DEFUN([CURL_CHECK_COMPILER_PROTOTYPE_MISMATCH], [
|
||||||
|
AC_REQUIRE([CURL_CHECK_COMPILER_HALT_ON_ERROR])dnl
|
||||||
|
AC_MSG_CHECKING([if compiler halts on function prototype mismatch])
|
||||||
|
AC_COMPILE_IFELSE([
|
||||||
|
AC_LANG_PROGRAM([[
|
||||||
|
# include <stdlib.h>
|
||||||
|
int rand(int n);
|
||||||
|
int rand(int n)
|
||||||
|
{
|
||||||
|
if(n)
|
||||||
|
return ++n;
|
||||||
|
else
|
||||||
|
return n;
|
||||||
|
}
|
||||||
|
]],[[
|
||||||
|
int i[2];
|
||||||
|
int j = rand(i[0]);
|
||||||
|
if(j)
|
||||||
|
return j;
|
||||||
|
]])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
AC_MSG_ERROR([compiler does not halt on function prototype mismatch.])
|
||||||
|
],[
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
])
|
||||||
|
])
|
||||||
|
|
||||||
|
|
||||||
dnl CURL_VAR_MATCH (VARNAME, VALUE)
|
dnl CURL_VAR_MATCH (VARNAME, VALUE)
|
||||||
dnl -------------------------------------------------
|
dnl -------------------------------------------------
|
||||||
dnl Verifies if shell variable VARNAME contains VALUE.
|
dnl Verifies if shell variable VARNAME contains VALUE.
|
||||||
|
Loading…
Reference in New Issue
Block a user