[PATCH] D128783: [test] Check for more -fsanitize=array-bounds regressions

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 29 06:27:08 PDT 2022


serge-sans-paille added a comment.

In D128783#3617924 <https://reviews.llvm.org/D128783#3617924>, @MaskRay wrote:

> Do we need a C test (just add a `-x c` RUN line)? @serge-sans-paille Do you think we may likely make C++ stricter than C?

I've started a similar discussion on https://reviews.llvm.org/D126864, but I'm fine to discuss that here :-)

Some extra data points:

GCC doesn't special case macro expansion, nor non-standard layout, not even size that result from the expansion of a template parameter.

I *guess* bounds resulting from macro expansion could result from preprocessor parameters and then are somehow variable.

I *guess*  bounds resulting from template parameter expansion could result from various template instantiation and then are somehow variable.

I don't have a clue about non-standard layout interaction with FAM.

Following Chesterton's fence <https://en.wiktionary.org/wiki/Chesterton%27s_fence> we should understand why this was introduced in Clang, because it turns out this actually causes issues to (some) users, and without that knowledge I'd be in favor of adopting GCC behavior and not making C++ stricter than C here.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D128783



More information about the cfe-commits mailing list