summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/extend.texi
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1998-07-15 04:22:45 +0000
committerjdp <jdp@FreeBSD.org>1998-07-15 04:22:45 +0000
commit0883088b05b344b5d8e9db4779e3fe152da60c5a (patch)
treee812844a0010b75b6fd2c3dccaec217b449b28c3 /contrib/gcc/extend.texi
parentbd9ef8a24a3df4493e225b33f9ae0c53888b7dd2 (diff)
downloadFreeBSD-src-0883088b05b344b5d8e9db4779e3fe152da60c5a.zip
FreeBSD-src-0883088b05b344b5d8e9db4779e3fe152da60c5a.tar.gz
Add support for a new archetype "printf0" for the "format" function
attribute. It is like the existing "printf" archetype, except that it doesn't complain if the format string is a null pointer. See the node "Function Attributes" in the GCC info pages if you don't know what this is all about. This change will allow us to add format string checking for the err(3) family of functions.
Diffstat (limited to 'contrib/gcc/extend.texi')
-rw-r--r--contrib/gcc/extend.texi16
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/gcc/extend.texi b/contrib/gcc/extend.texi
index e85799c..8eee030 100644
--- a/contrib/gcc/extend.texi
+++ b/contrib/gcc/extend.texi
@@ -1394,13 +1394,15 @@ for consistency with the @code{printf} style format string argument
@code{my_format}.
The parameter @var{archetype} determines how the format string is
-interpreted, and should be either @code{printf} or @code{scanf}. The
-parameter @var{string-index} specifies which argument is the format
-string argument (starting from 1), while @var{first-to-check} is the
-number of the first argument to check against the format string. For
-functions where the arguments are not available to be checked (such as
-@code{vprintf}), specify the third parameter as zero. In this case the
-compiler only checks the format string for consistency.
+interpreted, and should be @code{printf}, @code{printf0}, or
+@code{scanf}. @code{printf0} allows the format string to be a null
+pointer, while @code{printf} does not. The parameter @var{string-index}
+specifies which argument is the format string argument (starting
+from 1), while @var{first-to-check} is the number of the first
+argument to check against the format string. For functions where
+the arguments are not available to be checked (such as @code{vprintf}),
+specify the third parameter as zero. In this case the compiler
+only checks the format string for consistency.
In the example above, the format string (@code{my_format}) is the second
argument of the function @code{my_print}, and the arguments to check
OpenPOWER on IntegriCloud