diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/configure b/configure index 1aaca9ab5c9..a2374a3ab6d 100755 --- a/configure +++ b/configure @@ -16142,7 +16142,7 @@ fi # Run tests below here # -------------------- -# Force use of our snprintf if system's doesn't do arg control +# For NLS, force use of our snprintf if system's doesn't do arg control. # See comment above at snprintf test for details. if test "$enable_nls" = yes -a "$pgac_need_repl_snprintf" = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf supports argument control" >&5 @@ -16436,6 +16436,50 @@ $as_echo "$pgac_cv_snprintf_size_t_support" >&6; } fi fi +# Force use of our snprintf if the system's doesn't handle buffer overrun +# as specified by C99. +if test "$pgac_need_repl_snprintf" = no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether snprintf reports buffer overrun per C99" >&5 +$as_echo_n "checking whether snprintf reports buffer overrun per C99... " >&6; } +if ${pgac_cv_snprintf_c99_result+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + pgac_cv_snprintf_c99_result=cross +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdio.h> +#include <string.h> + +int main() +{ + char buf[10]; + + if (snprintf(buf, sizeof(buf), "12345678901234567890") != 20) + return 1; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + pgac_cv_snprintf_c99_result=yes +else + pgac_cv_snprintf_c99_result=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_snprintf_c99_result" >&5 +$as_echo "$pgac_cv_snprintf_c99_result" >&6; } + + if test "$pgac_cv_snprintf_c99_result" != yes; then + pgac_need_repl_snprintf=yes + fi +fi + # Now we have checked all the reasons to replace snprintf if test $pgac_need_repl_snprintf = yes; then |