[PATCH] D83717: [clang-tidy] Add check fo SEI CERT item ENV32-C

Endre Fülöp via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 15 02:31:03 PDT 2020


gamesh411 marked 12 inline comments as done.
gamesh411 added inline comments.


================
Comment at: clang-tools-extra/clang-tidy/cert/ExitHandlerCheck.cpp:132
+           "terminate by returning");
+      break;
+    }
----------------
steakhal wrote:
> Why don't we `return` here?
> Same for the next `break`.
I use `break`, because it is more local to the concept of finishing the loop (ie the visitation algorithm), and that is what I want the reader of the code to receive after reading the line. In this particular case, `return` is equivalent to break but I would still keep it this way, because that is what I want to say, and if someone were to extend the code later, that early `return` inside the loop could surprise them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83717





More information about the cfe-commits mailing list