[PATCH] D58797: [Sema] Add some compile time _FORTIFY_SOURCE diagnostics

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Mar 26 11:33:04 PDT 2019


aaron.ballman added a comment.

In D58797#1439888 <https://reviews.llvm.org/D58797#1439888>, @erik.pilkington wrote:

> Ah, I didn't consider that case. Presumably `st` is configured to have different sizes based on the target? I agree that this is a false-positive, but it seems like a pretty narrow edge case, and there is a pretty obvious source workaround that doesn't affect readability: `memcpy(&buf, st, sizeof(buf))`. @aaron.ballman/@rsmith Any thoughts here? IMO keeping this diagnostic is worth it.


Yes, I think we should keep this diagnostic. However, if we can find a way to silence it for this particular false-positive pattern, that would be great!


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58797/new/

https://reviews.llvm.org/D58797





More information about the cfe-commits mailing list