[PATCH] D50805: Don't warn on returning the address of a label

Roman Lebedev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 15 13:57:06 PDT 2018


lebedev.ri added inline comments.


================
Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:7872-7874
-def warn_ret_addr_label : Warning<
-  "returning address of label, which is local">,
-  InGroup<ReturnStackAddress>;
----------------
Why completely drop the diagnostic just because it is undesired in linux code?
Why not just add an `-Wreturn-stack-address` diag option instead, and disable it if undesired?


https://reviews.llvm.org/D50805





More information about the cfe-commits mailing list