diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-14 00:22:00 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-02-14 00:22:00 +0000 |
commit | 7cdc31147b4a8a5bc9681097744ba4583dc0b91a (patch) | |
tree | 2a4d80af5ed6063f1e96a05116996abb7a52899c | |
parent | 6f488191a3a82b19e5854b15b0d56e5a5fb6cf80 (diff) |
Some grammar fixes to 'Format String Checking', and reorder the text slightly to try to make the final code block actually get rendered.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175112 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | docs/LanguageExtensions.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/docs/LanguageExtensions.rst b/docs/LanguageExtensions.rst index b069144bfc..dd54cfff5c 100644 --- a/docs/LanguageExtensions.rst +++ b/docs/LanguageExtensions.rst @@ -1936,7 +1936,7 @@ Clang implements two kinds of checks with this attribute. for functions that accept a ``va_list`` argument (for example, ``vprintf``). GCC does not emit ``-Wformat-nonliteral`` warning for calls to such fuctions. Clang does not warn if the format string comes from a function - parameter, where function is annotated with a compatible attribute, + parameter, where the function is annotated with a compatible attribute, otherwise it warns. For example: .. code-block:: c @@ -1950,14 +1950,12 @@ Clang implements two kinds of checks with this attribute. } In this case we warn because ``s`` contains a format string for a - ``scanf``-like function, but it is passed it to a ``printf``-like function. + ``scanf``-like function, but it is passed to a ``printf``-like function. If the attribute is removed, clang still warns, because the format string is not a string literal. - But in this case Clang does not warn because the format string ``s`` and - corresponding arguments are annotated. If the arguments are incorrect, - caller of ``foo`` will get a warning. + Another example: .. code-block: c @@ -1969,3 +1967,6 @@ Clang implements two kinds of checks with this attribute. vprintf(s, ap); // warning } + In this case Clang does not warn because the format string ``s`` and + the corresponding arguments are annotated. If the arguments are + incorrect, the caller of ``foo`` will receive a warning. |