Skip to content

Commit 5242921

Browse files
authored
[-Wunsafe-buffer-usage] Accept calls to some libc functions with annotated arguments & Let libc warnings yield to bounds attributes (#10182)
Cherry-pick two commits: * [Upstream][C++ Safe Buffers] Let libc warnings yield to bounds attributes For a call to an unsafe libc function, do not warn about it if its callee function has any bounds attributes. Because we can verify the safety of the call using bounds attributes. (rdar://140138380) * [-Wunsafe-buffer-usage] Accept calls to some libc functions with annotated arguments (#10088) - `printf`, `fprintf` `snprintf` functions accept `__null_terminated` - `snprintf` function accepts `__counted_by/__sized_by` - functions consuming a single string pointer like `strlen` or `atoi` accept `__null_terminated` Generalized `isCountAttributedPointerArgumentSafe` so that it is shared by interoperation gadgets and the unsafe libc gadget. (A follow-up change to rdar://138798346)
1 parent 83f3a74 commit 5242921

6 files changed

+368
-111
lines changed

0 commit comments

Comments
 (0)