diff options
author | Ben Elliston <bje@redhat.com> | 2003-02-18 10:51:57 +0000 |
---|---|---|
committer | Ben Elliston <bje@gcc.gnu.org> | 2003-02-18 21:51:57 +1100 |
commit | f57a2e3a8ae273d4db185f7d0be3f68024ca4763 (patch) | |
tree | 186c4f8967a25b469cffb510bb8efbbdd3c6ccdc /gcc | |
parent | 69c107efe49360359ac10ab2172fafaf0a665deb (diff) | |
download | gcc-f57a2e3a8ae273d4db185f7d0be3f68024ca4763.zip gcc-f57a2e3a8ae273d4db185f7d0be3f68024ca4763.tar.gz gcc-f57a2e3a8ae273d4db185f7d0be3f68024ca4763.tar.bz2 |
re PR c++/1607 ([3.3 only] Format attributes on methods undocumented)
PR c++/1607
* doc/extend.texi (Function Attributes): Document the effect of
the C++ "this" parameter on the counting of arguments for the
"format" and "format_arg" attributes.
From-SVN: r63030
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/doc/extend.texi | 7 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index e34ead5..5500f28 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-02-18 Ben Elliston <bje@redhat.com> + + PR c++/1607 + * doc/extend.texi (Function Attributes): Document the effect of + the C++ "this" parameter on the counting of arguments for the + "format" and "format_arg" attributes. + 2003-02-17 Aldy Hernandez <aldyh@redhat.com> * config/rs6000/spe.h (__ev_stdd): Cast 2nd arg. diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 2ca034b..86e0491 100644 --- a/gcc/doc/extend.texi +++ b/gcc/doc/extend.texi @@ -2101,6 +2101,9 @@ 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. For @code{strftime} formats, the third parameter is required to be zero. +Since non-static C++ methods have an implicit @code{this} argument, the +arguments of such methods should be counted from two, not one, when +giving values for @var{string-index} and @var{first-to-check}. 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 @@ -2153,7 +2156,9 @@ string argument is not constant; this would generate a warning when without the attribute. The parameter @var{string-index} specifies which argument is the format -string argument (starting from 1). +string argument (starting from one). Since non-static C++ methods have +an implicit @code{this} argument, the arguments of such methods should +be counted from two. The @code{format-arg} attribute allows you to identify your own functions which modify format strings, so that GCC can check the |