[PATCH] D22196: Fix Bug "28480 - cppcoreguidelines-pro-bounds-array-to-pointer-decay handling __PRETTY_FUNCTION__"

Eric Lemanissier via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 14 06:17:10 PDT 2016


ericLemanissier added a comment.

having studied cpp core guidelines in more depth, I completely understand that the problem in the case I described is that the function receiving PRETTY_FUNCTION takes a const char* parameter, whereas it should take a czstring or szstring_span. As a consequence this patch is not a good thing.

> In case it is not possible to change this function, I guess the only solution is static_cast<const char*>(__PRETTY_FUNCTION)


The function I refer to in this sentence is not ProBoundsArrayToPointerDecayCheck::registerMatchers, it is the function in user code receiving PRETTY_FUNCTION.


https://reviews.llvm.org/D22196





More information about the cfe-commits mailing list