Skip to content

Commit

Permalink
add %pS as allowed format specifier
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzocarrozzo authored and yonghong-song committed Dec 9, 2023
1 parent eb8ede2 commit 6fd39b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cc/frontends/clang/b_frontend_action.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1294,9 +1294,12 @@ bool BTypeVisitor::checkFormatSpecifiers(const string& fmt, SourceLocation loc)
i++;
} else if (fmt[i] == 'p' || fmt[i] == 's') {
i++;
if (fmt[i-1] == 'p' && fmt[i] == 'S') {
i++;
}
if (!isspace(fmt[i]) && !ispunct(fmt[i]) && fmt[i] != 0) {
warning(loc.getLocWithOffset(i - 2),
"only %%d %%u %%x %%ld %%lu %%lx %%lld %%llu %%llx %%p %%s conversion specifiers allowed");
"only %%d %%u %%x %%ld %%lu %%lx %%lld %%llu %%llx %%p %%pS %%s conversion specifiers allowed");
return false;
}
if (fmt[i - 1] == 's') {
Expand Down

0 comments on commit 6fd39b6

Please sign in to comment.