ports/devel/llvm-devel/files/patch-tools_clang_lib_Sema_SemaChecking.cpp
Brooks Davis 45e5bc018a Update to r65948.
Add printf0 support. [1]

Install the clang C headers (excluding std*.h since we have our own) now
that the installer puts them somewhere sane.

Submitted by:	ed
2009-03-03 18:12:02 +00:00

39 lines
935 B
C++

$FreeBSD$
--- tools/clang/lib/Sema/SemaChecking.cpp.orig
+++ tools/clang/lib/Sema/SemaChecking.cpp
@@ -142,7 +142,7 @@
// Printf checking.
if (const FormatAttr *Format = FDecl->getAttr<FormatAttr>()) {
- if (Format->getType() == "printf") {
+ if (Format->getType() == "printf" || Format->getType() == "printf0") {
bool HasVAListArg = Format->getFirstArg() == 0;
if (!HasVAListArg) {
if (const FunctionProtoType *Proto
@@ -701,7 +701,6 @@
case 'u':
case 'x':
case 'X':
- case 'D':
case 'O':
case 'U':
case 'e':
@@ -717,9 +716,16 @@
case 'S':
case 's':
case 'p':
+ case 'r':
+ case 'y':
++numConversions;
CurrentState = state_OrdChr;
break;
+ case 'b':
+ case 'D':
+ numConversions += 2;
+ CurrentState = state_OrdChr;
+ break;
// CHECK: Are we using "%n"? Issue a warning.
case 'n': {