[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-27 Thread Bill Wendling via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7f93ae808634: [clang] Implement -fstrict-flex-arrays=3 (authored by void). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://reviews.llvm.or

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-26 Thread serge via Phabricator via cfe-commits
serge-sans-paille accepted this revision. serge-sans-paille added a comment. Looks good! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://reviews.llvm.org/D134902 ___ cfe-commits mailing

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-26 Thread Kees Cook via Phabricator via cfe-commits
kees accepted this revision. kees added a comment. The self-tests all look correct to me, so I expect it is working how I'd expect. I haven't had a chance to do kernel builds with this yet, but I'm hoping to make time soon. I'd say if others are happy, let's land it, and if anything unexpected

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-26 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. Quick ping to @kees and @serge-sans-paille for any comments. :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://reviews.llvm.org/D134902 ___ cfe-commits mailing li

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. In D134902#3883209 , @void wrote: > In D134902#3882255 , @aaron.ballman > wrote: > >> One thin

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-25 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. In D134902#3882255 , @aaron.ballman wrote: > One thing I would appreciate is, once we're getting close to done with the > work around flexible arrays, is to explicitly document our > implementation-defined behaviors around flexibl

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-25 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 470561. void added a comment. Update the release notes to something resembling English. Also add a better explanation of what "3" means. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://reviews.ll

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-25 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D134902#3848616 , @kees wrote: > In D134902#3848595 , > @serge-sans-paille wrote: > >> I second the opinion here. C99 says nothing about flexible array member for >> unions, tha

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-24 Thread Bill Wendling via Phabricator via cfe-commits
void added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:60 /// static_asserts in Triple.cpp and in clang/Basic/HLSLRuntime.h. enum class ShaderStage { Pixel = 0, serge-sans-paille wrote: > Looks unrelated to this patch :-) I don't se

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-21 Thread serge via Phabricator via cfe-commits
serge-sans-paille added inline comments. Comment at: clang/include/clang/Basic/LangOptions.h:60 /// static_asserts in Triple.cpp and in clang/Basic/HLSLRuntime.h. enum class ShaderStage { Pixel = 0, Looks unrelated to this patch :-) Comme

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-21 Thread Bill Wendling via Phabricator via cfe-commits
void added a comment. This should be ready for review. PTAL. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://reviews.llvm.org/D134902 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-21 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 469807. void added a comment. Add a release note. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://reviews.llvm.org/D134902 Files: clang/docs/ReleaseNotes.rst clang/include/clang/Basic/LangOp

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-21 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 469805. void added a comment. Integrate the new flag level into the FAM predicate. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://reviews.llvm.org/D134902 Files: clang/include/clang/Basic/Lan

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-17 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/test/CodeGen/bounds-checking-fam.c:2 // REQUIRES: x86-registered-target -// RUN: %clang_cc1 -emit-llvm -triple x86_64 -fstrict-flex-arrays=0 -fsanitize=array-bounds%s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-STR

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-10 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. In D134902#3848595 , @serge-sans-paille wrote: > I second the opinion here. C99 says nothing about flexible array member for > unions, that's already a "language extension". (and so not be considered as > FAM by `-fstrict-flex-arr

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-10 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. In D134902#3848246 , @void wrote: > @rsmith, @serge-sans-paille, and @kees, I need some advice. There's a test in > `clang/test/CodeGen/bounds-checking.c` that's checking bounds stuff on > unions. The behavior is...weird to me. It

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-10 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. In D134902#3848246 , @void wrote: > @rsmith, @serge-sans-paille, and @kees, I need some advice. There's a test in > `clang/test/CodeGen/bounds-checking.c` that's checking bounds stuff on > unions. The behavior is...wei

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-10 Thread Bill Wendling via Phabricator via cfe-commits
void added a reviewer: rsmith. void added a subscriber: rsmith. void added a comment. @rsmith, @serge-sans-paille, and @kees, I need some advice. There's a test in `clang/test/CodeGen/bounds-checking.c` that's checking bounds stuff on unions. The behavior is...weird to me. It says that an array

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-07 Thread Bill Wendling via Phabricator via cfe-commits
void updated this revision to Diff 466011. void added a comment. Herald added subscribers: steakhal, martong. Herald added a reviewer: NoQ. Update comments to reflect reality. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134902/new/ https://review

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-07 Thread Bill Wendling via Phabricator via cfe-commits
void marked an inline comment as done. void added inline comments. Comment at: clang/test/CodeGen/bounds-checking-fam.c:2 // REQUIRES: x86-registered-target -// RUN: %clang_cc1 -emit-llvm -triple x86_64 -fstrict-flex-arrays=0 -fsanitize=array-bounds%s -o - | FileCheck %

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-06 Thread serge via Phabricator via cfe-commits
serge-sans-paille added inline comments. Comment at: clang/test/CodeGen/object-size-flex-array.c:45 + // CHECK-STRICT-2: ret i32 -1 + // CHECK-STRICT-3: ret i32 0 return OBJECT_SIZE_BUILTIN(f->c, 1); kees wrote: > serge-sans-paille wrote: > > This one worrie

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-05 Thread Kees Cook via Phabricator via cfe-commits
kees added inline comments. Comment at: clang/test/CodeGen/object-size-flex-array.c:45 + // CHECK-STRICT-2: ret i32 -1 + // CHECK-STRICT-3: ret i32 0 return OBJECT_SIZE_BUILTIN(f->c, 1); serge-sans-paille wrote: > This one worries me a bit, as an array of si

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-10-05 Thread serge via Phabricator via cfe-commits
serge-sans-paille added inline comments. Comment at: clang/test/CodeGen/bounds-checking-fam.c:2 // REQUIRES: x86-registered-target -// RUN: %clang_cc1 -emit-llvm -triple x86_64 -fstrict-flex-arrays=0 -fsanitize=array-bounds%s -o - | FileCheck %s --check-prefixes=CHECK,

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-09-30 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment. I think this is missing a change in SemaChecking.cpp too. It would probably be better to first merge https://reviews.llvm.org/D134791 so that you don't have to patch (too much) multiple places :-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-09-29 Thread Kees Cook via Phabricator via cfe-commits
kees added inline comments. Comment at: clang/test/CodeGen/bounds-checking-fam.c:23 }; // CHECK-LABEL: define {{.*}} @{{.*}}test_one{{.*}}( I would expect to see here: ``` struct Zero { int a[0]; }; // CHECK-LABEL: define {{.*}} @{{.*}}test_zero{{.*}}( in

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-09-29 Thread Kees Cook via Phabricator via cfe-commits
kees added a comment. Excellent! Thank you for getting this prepared. Having this properly managed in the kernel means we don't have to do horrible ugly hacks to work around old 0-length arrays in UAPI (which have all been unioned with a proper flexible array now). Repository: rG LLVM Githu

[PATCH] D134902: [clang] Implement -fstrict-flex-arrays=3

2022-09-29 Thread Bill Wendling via Phabricator via cfe-commits
void created this revision. void added a reviewer: kees. Herald added a project: All. void requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. The -fstrict-flex-arrays=3 is the most restrictive type of flex arrays. No number, including 0, is al