Skip to content

Commit cc7d084

Browse files
authored
[clang][Sema] Enable the kprintf format attribute (llvm#100669)
1 parent 52574b5 commit cc7d084

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

clang/lib/Sema/SemaChecking.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8103,8 +8103,9 @@ static void CheckFormatString(
81038103
}
81048104

81058105
if (Type == Sema::FST_Printf || Type == Sema::FST_NSString ||
8106-
Type == Sema::FST_FreeBSDKPrintf || Type == Sema::FST_OSLog ||
8107-
Type == Sema::FST_OSTrace || Type == Sema::FST_Syslog) {
8106+
Type == Sema::FST_Kprintf || Type == Sema::FST_FreeBSDKPrintf ||
8107+
Type == Sema::FST_OSLog || Type == Sema::FST_OSTrace ||
8108+
Type == Sema::FST_Syslog) {
81088109
CheckPrintfHandler H(
81098110
S, FExpr, OrigFormatExpr, Type, firstDataArg, numDataArgs,
81108111
(Type == Sema::FST_NSString || Type == Sema::FST_OSTrace), Str, APK,
@@ -8113,7 +8114,7 @@ static void CheckFormatString(
81138114

81148115
if (!analyze_format_string::ParsePrintfString(
81158116
H, Str, Str + StrLen, S.getLangOpts(), S.Context.getTargetInfo(),
8116-
Type == Sema::FST_FreeBSDKPrintf))
8117+
Type == Sema::FST_Kprintf || Type == Sema::FST_FreeBSDKPrintf))
81178118
H.DoneProcessing();
81188119
} else if (Type == Sema::FST_Scanf) {
81198120
CheckScanfHandler H(S, FExpr, OrigFormatExpr, Type, firstDataArg,

0 commit comments

Comments
 (0)