summaryrefslogtreecommitdiffstats
path: root/clang/lib/Analysis/FormatString.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* scanf analysis: the 'a' length modifier is valid with a scanlistHans Wennborg2012-01-121-0/+1
| | | | | | | Before r148025 we (accidentally) didn't check whether a length modifier is appropriate for a scanlist, but now we do. llvm-svn: 148026
* Support the 'a' scanf length modifier as an extension in C++.Hans Wennborg2011-12-281-1/+1
| | | | | | | It should not be supported in C++11, since that uses the C99 standard library, in which 'a' is a format specifier. llvm-svn: 147310
* Support the 'a' length modifier in scanf format strings as a C90Hans Wennborg2011-12-151-1/+28
| | | | | | | | | extension. This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess errors). llvm-svn: 146649
* Make printf warnings refer to wint_t and wchar_t by nameHans Wennborg2011-12-091-5/+4
| | | | | | in addition to underlying type. llvm-svn: 146254
* Move definition of ConversionSpecifier::toString() to FormatString.cppHans Wennborg2011-12-091-4/+41
| | | | | | | It's declared in FormatString.h, so it shouldn't be defined in PrintfFormatString.cpp. llvm-svn: 146253
* Make printf warnings refer to intmax_t et al. by nameHans Wennborg2011-12-071-2/+9
| | | | | | | | | | | | in addition to underlying type. For example, the warning for printf("%zu", 42.0); changes from "conversion specifies type 'unsigned long'" to "conversion specifies type 'size_t' (aka 'unsigned long')" (This is a second attempt after r145697, which got reverted.) llvm-svn: 146032
* Revert r145697 and dependent patch r145702. It added a dependency fromNick Lewycky2011-12-021-12/+13
| | | | | | lib/Analysis to lib/Sema which is cyclical. llvm-svn: 145724
* Make conversion specifier warning refer to typedef if possible.Hans Wennborg2011-12-021-13/+12
| | | | | | | | For example, the warning for printf("%zu", 42.0); changes from "conversion specifies type 'unsigned long'" to "conversion specifies type 'size_t' (aka 'unsigned long')" llvm-svn: 145697
* Tweak printf format string parsing to accept 'hh' conversion specifier to ↵Ted Kremenek2011-10-251-5/+21
| | | | | | accept any char, not just signed char. Fixes <rdar://problem/10303638>. llvm-svn: 142908
* Removing a bunch of dead returns/breaks after llvm_unreachables.David Blaikie2011-09-231-2/+0
| | | | llvm-svn: 140407
* Switch assert(0/false) llvm_unreachable.David Blaikie2011-09-231-2/+2
| | | | llvm-svn: 140367
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-1/+1
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Revert r135147 and r135075. The consensus was that this wasn't the right ↵Ted Kremenek2011-07-141-14/+12
| | | | | | thing to do. llvm-svn: 135152
* Add extra sanity checking in FormatString::matchesType() that we are ↵Ted Kremenek2011-07-141-3/+6
| | | | | | comparing integers to integers. This happens not to be an issue now, but the extra check helps future proof in case of future refactorings. llvm-svn: 135147
* Reapply r135075, but modify format-strings.c and format-strings-fixit.c test ↵Ted Kremenek2011-07-141-10/+9
| | | | | | cases to be more portable with an explicit target triple. llvm-svn: 135134
* Revert r135075, "format string checking: long and int have the same widths ↵NAKAMURA Takumi2011-07-141-9/+10
| | | | | | | | on 32-bit, so we shouldn't warn about using" It fails on freebsd, mingw and msvc10. llvm-svn: 135129
* format string checking: long and int have the same widths on 32-bit, so we ↵Ted Kremenek2011-07-131-10/+9
| | | | | | | | shouldn't warn about using an "int" format specifier with a "long" type in 32-bit. llvm-svn: 135075
* Re-relax conversion specifier checking for printf format strings and ↵Ted Kremenek2011-07-131-3/+4
| | | | | | conversion specifiers. My recent change was a mistake. llvm-svn: 135048
* Fix inversion in argument type checking for format strings with conversion ↵Ted Kremenek2011-07-131-2/+2
| | | | | | specifiers for character types. llvm-svn: 135046
* Revert r133024, "[format strings] correctly suggest correct type for '%@'Daniel Dunbar2011-06-281-2/+1
| | | | | | | | | specifiers. Fixes <rdar://problem/9607158>." because it causes false positives on some code that uses CF toll free bridging. - I'll let Doug or Ted figure out the right fix here, possibly just to accept any pointer type. llvm-svn: 134041
* [format strings] correctly suggest correct type for '%@' specifiers. Fixes ↵Ted Kremenek2011-06-141-1/+2
| | | | | | <rdar://problem/9607158>. llvm-svn: 133024
* Don't warn when matching %p to nullptr.Anders Carlsson2010-11-061-2/+2
| | | | llvm-svn: 118344
* Fix printf format string checking for '%lc' (which expects a wint_t or ↵Ted Kremenek2010-08-241-0/+21
| | | | | | compatible argument). Fixes PR 7981. llvm-svn: 111978
* Detabify.Eli Friedman2010-08-221-1/+1
| | | | llvm-svn: 111768
* Revert r109428 "Hoist argument type checking into CheckFormatHandler. This ↵Michael J. Spencer2010-07-271-3/+1
| | | | | | | | is prep for scanf format" Got errors about ASTContext being undefined with Visual Studio 2010. llvm-svn: 109491
* Hoist argument type checking into CheckFormatHandler. This is prep for ↵Ted Kremenek2010-07-261-1/+3
| | | | | | | | scanf format string argument type checking. llvm-svn: 109428
* Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.Ted Kremenek2010-07-201-2/+75
| | | | llvm-svn: 108906
* Add most of the boilerplate support for scanf format string checking. This ↵Ted Kremenek2010-07-161-0/+380
includes handling the parsing of scanf format strings and hooking the checking into Sema. Most of this checking logic piggybacks on what was already there for checking printf format strings, but the checking logic has been refactored to support both. What is left to be done is to support argument type checking in format strings and of course fix the usual tail of bugs that will follow. llvm-svn: 108500
OpenPOWER on IntegriCloud