From 134a253edc5f885d497e112f3db97679bff912c0 Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Sat, 9 May 2020 19:26:44 +0000 Subject: clang: Reject %n for __attribute__((format(__freebsd_kprintf__))) A follow-up to r360849. Reported by: imp Reviewed by: emaste, imp X-MFC-With: r360849 Differential Revision: https://reviews.freebsd.org/D24786 --- contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'contrib/llvm-project/clang/lib/AST') diff --git a/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp b/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp index bae60d464407..dabc39c57ef7 100644 --- a/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp +++ b/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp @@ -316,8 +316,8 @@ static PrintfSpecifierResult ParsePrintfSpecifier(FormatStringHandler &H, case 'g': k = ConversionSpecifier::gArg; break; case 'i': k = ConversionSpecifier::iArg; break; case 'n': - // Not handled, but reserved in OpenCL. - if (!LO.OpenCL) + // Not handled, but reserved in OpenCL and FreeBSD kernel. + if (!LO.OpenCL && !isFreeBSDKPrintf) k = ConversionSpecifier::nArg; break; case 'o': k = ConversionSpecifier::oArg; break; -- cgit v1.2.3