diff options
author | Jordan Rose <jordan_rose@apple.com> | 2012-09-08 04:00:03 +0000 |
---|---|---|
committer | Jordan Rose <jordan_rose@apple.com> | 2012-09-08 04:00:03 +0000 |
commit | bbb6bb4952b77e57b842b4d3096848123ae690e7 (patch) | |
tree | d818e14d06c2b7cc7f7b0164f31e6bb5f40c8388 /include/clang | |
parent | 7ac9ef1c82c779a5348ed11b3d10e01c58803b35 (diff) |
Format strings: %Ld isn't available on Darwin or Windows.
This seems to be a GNU libc extension; we offer a fixit to %lld on
these platforms.
<rdar://problem/11518237>
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163452 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Analysis/Analyses/FormatString.h | 6 | ||||
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/include/clang/Analysis/Analyses/FormatString.h b/include/clang/Analysis/Analyses/FormatString.h index 7f50ee392b..c69f17a928 100644 --- a/include/clang/Analysis/Analyses/FormatString.h +++ b/include/clang/Analysis/Analyses/FormatString.h @@ -23,6 +23,8 @@ namespace clang { +class TargetInfo; + //===----------------------------------------------------------------------===// /// Common components of both fprintf and fscanf format strings. namespace analyze_format_string { @@ -348,10 +350,12 @@ public: bool usesPositionalArg() const { return UsesPositionalArg; } - bool hasValidLengthModifier() const; + bool hasValidLengthModifier(const TargetInfo &Target) const; bool hasStandardLengthModifier() const; + llvm::Optional<LengthModifier> getCorrectedLengthModifier() const; + bool hasStandardConversionSpecifier(const LangOptions &LangOpt) const; bool hasStandardLengthConversionCombination() const; diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 2b6cb4c34e..a222e0aad3 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -5474,6 +5474,7 @@ def warn_scanf_scanlist_incomplete : Warning< "no closing ']' for '%%[' in scanf format string">, InGroup<Format>; def note_format_string_defined : Note<"format string is defined here">; +def note_format_fix_specifier : Note<"did you mean to use '%0'?">; def note_printf_c_str: Note<"did you mean to call the %0 method?">; def warn_null_arg : Warning< |