Skip to content

Commit

Permalink
Fix checking for existing builtin overflow functions
Browse files Browse the repository at this point in the history
This patch fixes commit 1ca5486, which added
support of using builtin overflow functions: __builtin_add_overflow,
__builtin_sub_overflow, __builtin_mul_overflow. The configure script tries to
compile a small program with one of these functions. Compilation was without any
errors, because to correctly check gcc requires flag
-Werror=implicit-function-declaration. This flag is added later.

This patch moves this check after flag -Werror=implicit-function-declaration is
added to CFLAGS.
  • Loading branch information
red1452 committed May 29, 2024
1 parent 0bace21 commit 741c681
Showing 1 changed file with 33 additions and 33 deletions.
66 changes: 33 additions & 33 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -17614,39 +17614,6 @@ esac

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_mul_overflow" >&5
$as_echo_n "checking for __builtin_mul_overflow... " >&6; }
if ${pgac_cv__builtin_op_overflow+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{
PG_INT64_TYPE result;
__builtin_mul_overflow((PG_INT64_TYPE) 1, (PG_INT64_TYPE) 2, &result);

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv__builtin_op_overflow=yes
else
pgac_cv__builtin_op_overflow=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_op_overflow" >&5
$as_echo "$pgac_cv__builtin_op_overflow" >&6; }
if test x"$pgac_cv__builtin_op_overflow" = xyes ; then

$as_echo "#define HAVE__BUILTIN_OP_OVERFLOW 1" >>confdefs.h

fi

# Check size of void *, size_t (enables tweaks for > 32bit address space)
# The cast to long int works around a bug in the HP C Compiler
# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
Expand Down Expand Up @@ -19823,6 +19790,39 @@ fi

fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_mul_overflow" >&5
$as_echo_n "checking for __builtin_mul_overflow... " >&6; }
if ${pgac_cv__builtin_op_overflow+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

int
main ()
{
PG_INT64_TYPE result;
__builtin_mul_overflow((PG_INT64_TYPE) 1, (PG_INT64_TYPE) 2, &result);

;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
pgac_cv__builtin_op_overflow=yes
else
pgac_cv__builtin_op_overflow=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__builtin_op_overflow" >&5
$as_echo "$pgac_cv__builtin_op_overflow" >&6; }
if test x"$pgac_cv__builtin_op_overflow" = xyes ; then

$as_echo "#define HAVE__BUILTIN_OP_OVERFLOW 1" >>confdefs.h

fi

# Begin output steps

{ $as_echo "$as_me:${as_lineno-$LINENO}: using CFLAGS=$CFLAGS" >&5
Expand Down

0 comments on commit 741c681

Please sign in to comment.