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
This commit is contained in:
Dimitry Andric 2020-08-06 19:23:00 +00:00
parent 497dd4e30f
commit ec280e9ec4

View File

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