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

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Mar 22 12:48:13 PDT 2019


nickdesaulniers 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?


Yes; sorry I was not clear about that in my example.

> 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))`.

Oh, yeah, we could make that source level change.

> @aaron.ballman/@rsmith Any thoughts here? IMO keeping this diagnostic is worth it.

I'm all for keeping it, I'm curious if it can be extended to NOT warn in the case provided?


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