diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-08-06 19:23:00 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-08-06 19:23:00 +0000 |
commit | ec280e9ec4b825ae73cdeccffeb8e72ce7dcc99d (patch) | |
tree | ed0035e1138802d7f38c9c01977f3579d493c37b /contrib/llvm-project | |
parent | 497dd4e30f74769630f8cadca302bb250b8bcaf1 (diff) | |
download | src-test-ec280e9ec4b825ae73cdeccffeb8e72ce7dcc99d.tar.gz src-test-ec280e9ec4b825ae73cdeccffeb8e72ce7dcc99d.zip |
Reapply r360852 (by cem):
clang: Reject %n for __attribute__((format(__freebsd_kprintf__)))
A follow-up to r360849.
Reported by: imp
Reviewed by: emaste, imp
Differential Revision: https://reviews.freebsd.org/D24786
Notes
Notes:
svn path=/projects/clang1100-import/; revision=363980
Diffstat (limited to 'contrib/llvm-project')
-rw-r--r-- | contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp b/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp index f3ac181214ac6..0de2b112fb8a2 100644 --- a/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp +++ b/contrib/llvm-project/clang/lib/AST/PrintfFormatString.cpp @@ -317,8 +317,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; |