?RCS: Revision 3.0.1.1 1994/10/29 16:08:55 ram
?RCS: patch36: created by ADO
?RCS:
-?MAKE:d_attribute_format d_attribute_malloc d_attribute_nonnull d_attribute_noreturn d_attribute_pure d_attribute_unused d_attribute_warn_unused_result: Myread Oldconfig cat cc ccflags rm Setvar contains
+?MAKE:d_attribute_format d_attribute_malloc d_attribute_nonnull \
+ d_attribute_noreturn d_attribute_pure d_attribute_unused \
+ d_attribute_warn_unused_result d_printf_format_null: \
+ Myread Oldconfig cat cc ccflags rm Setvar contains i_stdlib run
?MAKE: -pick add $@ %<
?S:d_attribute_format (d_attribut_format.U):
?S: This variable conditionally defines HASATTRIBUTE_FORMAT, which
?S: indicates the C compiler can check for printf-like formats.
?S:.
+?S:d_printf_format_null:
+?S: This variable conditionally defines PRINTF_FORMAT_NULL_OK, which
+?S: indicates the C compiler allows printf-like formats to be null.
+?S:.
?S:d_attribute_malloc (d_attribute_malloc.U):
?S: This variable conditionally defines HASATTRIBUTE_MALLOC, which
?S: indicates the C compiler can understand functions as having
?C:HASATTRIBUTE_FORMAT ~ %< (GNUC_ATTRIBUTE_CHECK):
?C: Can we handle GCC attribute for checking printf-style formats
?C:.
+?C:PRINTF_FORMAT_NULL_OK:
+?C: Allows __printf__ format to be null when checking printf-style
+?C:.
?C:HASATTRIBUTE_MALLOC:
?C: Can we handle GCC attribute for malloc-style functions.
?C:.
?C: Can we handle GCC attribute for warning on unused results
?C:.
?H:?%<:#$d_attribute_format HASATTRIBUTE_FORMAT /**/
+?H:?%<:#$d_printf_format_null PRINTF_FORMAT_NULL_OK /**/
?H:?%<:#$d_attribute_noreturn HASATTRIBUTE_NORETURN /**/
?H:?%<:#$d_attribute_malloc HASATTRIBUTE_MALLOC /**/
?H:?%<:#$d_attribute_nonnull HASATTRIBUTE_NONNULL /**/
?H:?%<:#$d_attribute_warn_unused_result HASATTRIBUTE_WARN_UNUSED_RESULT /**/
?H:.
?LINT:set d_attribute_format
+?LINT:set d_printf_format_null
?LINT:set d_attribute_malloc
?LINT:set d_attribute_nonnull
?LINT:set d_attribute_noreturn
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 <<EOCP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#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
'')