A follow-up to r360849.
Reported by: imp
Differential D24786
clang: Reject %n for __attribute__((format(__freebsd_kprintf__))) cem on May 9 2020, 5:53 PM. Authored by Tags None Referenced Files
Subscribers None
Details A follow-up to r360849. Reported by: imp Seems to work: /home/conrad/a.c:94:21: warning: invalid conversion specifier 'n' [-Wformat-invalid-specifier] my_kprintflike("2 %n %s\n", &loops, "not ok"); ~^ a.c: extern void my_kprintflike(const char *s, ...) __attribute__((__format__(__freebsd_kprintf__, 1, 2))); int main(int argc, char **argv) { … my_kprintflike("1 %s\n", "ok"); my_kprintflike("2 %n %s\n", &loops, "not ok"); }
Diff Detail
Event TimelineComment Actions Hm, unfortunately our contrib version of LLVM excludes the test subdirectories, so I can't easily add a test case here. I expect it would be easy for someone with an existing upstream relationship with LLVM to write one. |