summaryrefslogtreecommitdiff
path: root/gcc/extend.texi
diff options
context:
space:
mode:
authorjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-29 07:38:20 +0000
committerjsm28 <jsm28@138bc75d-0d04-0410-961f-82ee72b054a4>2000-11-29 07:38:20 +0000
commit0f502901fa4ab3b1d4253df51974c8f3b0a1991d (patch)
treef226db8f7b8376e8ec3b05be047fdd8b28bd184f /gcc/extend.texi
parent93a3f6ec8586e142af6c4cf72ee0fe4dd1707c61 (diff)
downloadgcc-0f502901fa4ab3b1d4253df51974c8f3b0a1991d.tar.gz
* extend.texi: Update documentation for default format attributes.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@37844 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/extend.texi')
-rw-r--r--gcc/extend.texi17
1 files changed, 12 insertions, 5 deletions
diff --git a/gcc/extend.texi b/gcc/extend.texi
index 1cf3a74b363..ed89139705e 100644
--- a/gcc/extend.texi
+++ b/gcc/extend.texi
@@ -1525,7 +1525,8 @@ 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.
+compiler only checks the format string for consistency. For
+@code{strftime} formats, the third parameter is required to be zero.
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
@@ -1534,12 +1535,16 @@ attribute are 2 and 3.
The @code{format} attribute allows you to identify your own functions
which take format strings as arguments, so that GNU CC can check the
-calls to these functions for errors. The compiler always checks formats
-for the ANSI library functions @code{printf}, @code{fprintf},
+calls to these functions for errors. The compiler always (unless
+@samp{-ffreestanding} is used) checks formats
+for the standard library functions @code{printf}, @code{fprintf},
@code{sprintf}, @code{scanf}, @code{fscanf}, @code{sscanf}, @code{strftime},
@code{vprintf}, @code{vfprintf} and @code{vsprintf} whenever such
warnings are requested (using @samp{-Wformat}), so there is no need to
-modify the header file @file{stdio.h}.
+modify the header file @file{stdio.h}. In C99 mode, the functions
+@code{snprintf}, @code{vsnprintf}, @code{vscanf}, @code{vfscanf} and
+@code{vsscanf} are also checked.
+@xref{C Dialect Options,,Options Controlling C Dialect}.
@item format_arg (@var{string-index})
@cindex @code{format_arg} function attribute
@@ -1568,7 +1573,9 @@ functions which modify format strings, so that GNU CC can check the
calls to @code{printf}, @code{scanf}, or @code{strftime} function whose
operands are a call to one of your own function. The compiler always
treats @code{gettext}, @code{dgettext}, and @code{dcgettext} in this
-manner.
+manner except when strict ISO C support is requested by @samp{-ansi} or
+an appropriate @samp{-std} option, or @samp{-ffreestanding} is used.
+@xref{C Dialect Options,,Options Controlling C Dialect}.
@item no_instrument_function
@cindex @code{no_instrument_function} function attribute