summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/format-strings-0x.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move the fixit for -Wformat-security to a note.Bob Wilson2016-03-151-0/+1
| | | | | | | | r263299 added a fixit for the -Wformat-security warning, but that runs into complications with our guideline that error recovery should be done as-if the fixit had been applied. Putting the fixit on a note avoids that. llvm-svn: 263584
* Add a format warning for "%p" with non-void* argsSeth Cantrell2015-03-041-0/+3
| | | | | | | | | | | | | | | | | | GCC -pedantic produces a format warning when the "%p" specifier is used with arguments that are not void*. It's useful for portability to be able to catch such warnings with clang as well. The warning is off by default in both gcc and with this patch. This patch enables it either when extensions are disabled with -pedantic, or with the specific flag -Wformat-pedantic. The C99 and C11 specs do appear to require arguments corresponding to 'p' specifiers to be void*: "If any argument is not the correct type for the corresponding conversion specification, the behavior is undefined." [7.19.6.1 p9], and of the 'p' format specifier "The argument shall be a pointer to void." [7.19.6.1 p8] Both printf and scanf format checking are covered. llvm-svn: 231211
* Implement C++'s restrictions on the type of an expression passed to a varargRichard Smith2013-08-051-0/+4
| | | | | | | | | | | | | function: it can't be 'void' and it can't be an initializer list. We give a hard error for these rather than treating them as undefined behavior (we can and probably should do the same for non-POD types in C++11, but as of this change we don't). Slightly rework the checking of variadic arguments in a function with a format attribute to ensure that certain kinds of format string problem (non-literal string, too many/too few arguments, ...) don't suppress this error. llvm-svn: 187735
* PR13099: Teach -Wformat about raw string literals, UTF-8 strings and Unicode ↵Richard Smith2012-06-131-0/+12
| | | | | | escape sequences. llvm-svn: 158390
* Support all null pointer literals in format strings.David Blaikie2012-02-101-0/+2
| | | | llvm-svn: 150276
* Tighten format string diagnostic and make it a bit clearer (and a bit closer ↵Ted Kremenek2012-01-201-1/+1
| | | | | | to GCC's). llvm-svn: 148579
* Support the 'a' scanf length modifier as an extension in C++.Hans Wennborg2011-12-281-0/+13
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
OpenPOWER on IntegriCloud