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
This commit is contained in:
Conrad Meyer 2020-05-09 19:26:44 +00:00
parent 26a578697c
commit 134a253edc

View File

@ -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;