llvm-project/clang/lib/Analysis
Seth Cantrell b480296e6c Add a format warning for "%p" with non-void* args
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
2015-03-04 03:12:10 +00:00
..
AnalysisDeclContext.cpp Update APIs that return a pair of iterators to return an iterator_range instead. 2015-02-06 17:25:10 +00:00
BodyFarm.cpp [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py 2015-01-14 11:29:14 +00:00
BodyFarm.h Add support for the static analyzer to synthesize function implementations from external model files. 2014-08-27 15:14:15 +00:00
CFG.cpp Removing LLVM_EXPLICIT, as MSVC 2012 was the last reason for requiring the macro. NFC; Clang edition. 2015-02-15 22:00:28 +00:00
CFGReachabilityAnalysis.cpp Rework CFG edges to encode potentially unreachable edges, instead of just making them NULL. 2014-02-27 00:24:00 +00:00
CFGStmtMap.cpp [C++11] Use 'nullptr'. Analysis edition. 2014-05-20 04:30:07 +00:00
CMakeLists.txt Reverting r214064 and r215650 while investigating a pesky performance regression 2014-09-23 08:34:41 +00:00
CallGraph.cpp [CallGraph] Make sure the edges are not missed due to re-declarations 2014-12-17 00:34:07 +00:00
CocoaConventions.cpp Excise <cctype> from Clang (except clang-tblgen) in favor of CharInfo.h. 2013-02-08 22:30:41 +00:00
CodeInjector.cpp [Analysis] Add missing newlines at end of file. 2014-10-09 20:34:45 +00:00
Consumed.cpp Reverting r214064 and r215650 while investigating a pesky performance regression 2014-09-23 08:34:41 +00:00
Dominators.cpp
FormatString.cpp Add a format warning for "%p" with non-void* args 2015-03-04 03:12:10 +00:00
FormatStringParsing.h Header guard canonicalization, clang part. 2014-08-13 16:25:19 +00:00
LiveVariables.cpp Update APIs that return a pair of iterators to return an iterator_range instead. 2015-02-06 17:25:10 +00:00
Makefile
ObjCNoReturn.cpp clang/lib/Analysis/ObjCNoReturn.cpp: Fix [-Wnewline-eof] 2012-09-13 05:53:17 +00:00
PostOrderCFGView.cpp Reverting r214064 and r215650 while investigating a pesky performance regression 2014-09-23 08:34:41 +00:00
PrintfFormatString.cpp Add support for analyzing FreeBSD kernel printf extensions. 2015-02-19 22:32:33 +00:00
ProgramPoint.cpp [analyzer] Improved checker naming in CFG dump. 2014-02-17 18:25:34 +00:00
PseudoConstantAnalysis.cpp [C++11] Use 'nullptr'. Analysis edition. 2014-05-20 04:30:07 +00:00
ReachableCode.cpp [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py 2015-01-14 11:29:14 +00:00
ScanfFormatString.cpp MS format strings: allow the 'h' length modifier with C, C, s and S (PR20808) 2014-09-04 21:39:52 +00:00
ThreadSafety.cpp Thread Safety Analysis: support adopting of locks, as implemented in 2015-02-04 21:16:17 +00:00
ThreadSafetyCommon.cpp [cleanup] Re-sort *all* #include lines with llvm/utils/sort_includes.py 2015-01-14 11:29:14 +00:00
ThreadSafetyLogical.cpp Fix line endings. 2014-05-28 11:19:43 +00:00
ThreadSafetyTIL.cpp Fixing a -Woverflow warning from GCC by using a more natural datatype for this operation. NFC. 2014-09-12 12:42:15 +00:00
UninitializedValues.cpp Make -Wuninitialized warn on pointer-to-member and comma operators. 2015-03-03 14:54:25 +00:00