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

George Burgess IV via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 14 13:35:45 PDT 2019


george.burgess.iv added a comment.

This LGTM; feel free to submit after Aaron stamps this.

Thanks again!



================
Comment at: clang/lib/Sema/SemaExpr.cpp:5929
 
+    checkFortifiedBuiltinMemoryFunction(FDecl, TheCall);
+
----------------
erik.pilkington wrote:
> george.burgess.iv wrote:
> > Why isn't this in CheckBuiltinFunctionCall?
> For the same reason I added the `bool` parameter to `getBuiltinCallee`, we don't usually consider calls to `__attribute__((overloadable))` be builtins, so we never reach `CheckBuiltinFunctionCall` for them. We're planning on using that attribute though:
> 
> ```
> int sprintf(__attribute__((pass_object_size(_FORTIFY_LEVEL))) char *buffer, const char *format, ...) 
>           __attribute__((overloadable)) __asm__("___sprintf_pass_object_size_chk");
> ```
SGTM


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

https://reviews.llvm.org/D58797





More information about the cfe-commits mailing list