From: H.Merijn Brand Date: Wed, 15 Nov 2006 21:36:30 +0000 (+0000) Subject: 1. Less Whoa there, based on a suggestion by Andy Dougherty X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dcb594bcd7c2ac9f0d01eff34aab9c6bb8e972c1;p=p5sagit%2Fp5-mst-13.2.git 1. Less Whoa there, based on a suggestion by Andy Dougherty 2. d_printf_format_null, based on a patch by Robin Barker p4raw-id: //depot/perl@29288 --- diff --git a/Configure b/Configure index 533bf25..c1c6027 100755 --- a/Configure +++ b/Configure @@ -26,7 +26,7 @@ # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $ # -# Generated on Wed Nov 8 17:31:20 CET 2006 [metaconfig 3.0 PL70] +# Generated on Wed Nov 15 22:26:01 CET 2006 [metaconfig 3.0 PL70] # (with additional metaconfig patches by perlbug@perl.org) cat >c1$$ <>whoa dflt=y -echo " " -echo "*** WHOA THERE!!! ***" >&4 -echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 +case "$hint" in + recommended) + case "$hintfile" in + '') echo "The $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; + *) echo "Hmm. Based on the hints in hints/$hintfile.sh, " >&4 + echo "the $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; + esac + ;; + *) echo " " + echo "*** WHOA THERE!!! ***" >&4 + echo " The $hint value for \$$var on this machine was \"$was\"!" >&4 + ;; +esac rp=" Keep the $hint value?" . ./myread case "$ans" in @@ -9977,6 +9990,50 @@ set d_attribute_format eval $setvar $rm -f attrib* +: Look for GCC-style attribute format with null format allowed +case "$d_printf_format_null" in +'') case "$d_attribute_format" in + $define) + echo " " + echo "Checking whether your compiler allows __printf__ format to be null ..." >&4 +$cat >attrib.c < +#$i_stdlib I_STDLIB +#ifdef I_STDLIB +#include +#endif +int null_printf (char* pat,...) __attribute__((__format__(__printf__,1,2))); +int null_printf (char* pat,...) { return (int)pat; } +int main () { exit(null_printf(NULL)); } +EOCP + if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then + : run the executable in case it produces a run-time warning + if $run ./attrib >>attrib.out 2>&1; then + if $contains 'warning' attrib.out >/dev/null 2>&1; then + echo "Your C compiler doesn't allow __printf__ format to be null." + val="$undef" + else + echo "Your C compiler allows __printf__ format to be null." + val="$define" + fi + else + echo "Your C compiler executable failed with __printf__ format null." + val="$undef" + fi + else + echo "Your C compiler fails with __printf__ format null." + val="$undef" + fi + ;; + *) val="$undef" ;; + esac +;; +*) val="$d_printf_format_null" ;; +esac +set d_printf_format_null +eval $setvar +$rm -f attrib* + : Look for GCC-style attribute malloc case "$d_attribute_malloc" in '') @@ -21668,6 +21725,7 @@ d_phostname='$d_phostname' d_pipe='$d_pipe' d_poll='$d_poll' d_portable='$d_portable' +d_printf_format_null='$d_printf_format_null' d_procselfexe='$d_procselfexe' d_pthread_atfork='$d_pthread_atfork' d_pthread_attr_setscope='$d_pthread_attr_setscope' diff --git a/Porting/Glossary b/Porting/Glossary index 0f89187..456697c 100644 --- a/Porting/Glossary +++ b/Porting/Glossary @@ -1541,6 +1541,10 @@ d_PRIi64 (quadfio.U): This variable conditionally defines the PERL_PRIi64 symbol, which indiciates that stdio has a symbol to print 64-bit decimal numbers. +d_printf_format_null: + This variable conditionally defines PRINTF_FORMAT_NULL_OK, which + indicates the C compiler allows printf-like formats to be null. + d_PRIo64 (quadfio.U): This variable conditionally defines the PERL_PRIo64 symbol, which indiciates that stdio has a symbol to print 64-bit octal numbers. diff --git a/config_h.SH b/config_h.SH index abcea7e..0bcdd3a 100644 --- a/config_h.SH +++ b/config_h.SH @@ -1156,6 +1156,9 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un /* HASATTRIBUTE_FORMAT: * Can we handle GCC attribute for checking printf-style formats */ +/* PRINTF_FORMAT_NULL_OK: + * Allows __printf__ format to be null when checking printf-style + */ /* HASATTRIBUTE_MALLOC: * Can we handle GCC attribute for malloc-style functions. */ @@ -1175,6 +1178,7 @@ sed <$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un * Can we handle GCC attribute for warning on unused results */ #$d_attribute_format HASATTRIBUTE_FORMAT /**/ +#$d_printf_format_null PRINTF_FORMAT_NULL_OK /**/ #$d_attribute_noreturn HASATTRIBUTE_NORETURN /**/ #$d_attribute_malloc HASATTRIBUTE_MALLOC /**/ #$d_attribute_nonnull HASATTRIBUTE_NONNULL /**/