[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-11-24 Thread Yingchi Long via Phabricator via cfe-commits
inclyc abandoned this revision. inclyc added a comment. Prefer https://reviews.llvm.org/D137343 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132952/new/ https://reviews.llvm.org/D132952 ___ cfe-commits

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-09 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. That sounds fine. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132952/new/ https://reviews.llvm.org/D132952 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D132952#3773469 , @inclyc wrote: >> Yeah, that's a different way of delineating than I was thinking originally >> and it's worth more thought. I was thinking the separation would be "this is >> a VLA" (for people who wa

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread YingChi Long via Phabricator via cfe-commits
inclyc added a comment. > Yeah, that's a different way of delineating than I was thinking originally > and it's worth more thought. I was thinking the separation would be "this is > a VLA" (for people who want to avoid all VLA stack allocations due to the > security concerns) and "this is a por

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } efriedma wrote: > aaro

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } aaron.ballman wrote: > efri

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } efriedma wrote: > aaro

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } aaron.ballman wrote: > efri

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } efriedma wrote: > aaro

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } aaron.ballman wrote: > efri

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } efriedma wrote: > aaro

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } aaron.ballman wrote: > aaro

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } aaron.ballman wrote: >

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-06 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } inclyc wrote: > aaron.

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-04 Thread YingChi Long via Phabricator via cfe-commits
inclyc added inline comments. Comment at: clang/test/Sema/warn-vla.c:8-12 +void test2(int n, int v[n]) { // c99 no-warning +#if __STDC_VERSION__ < 199901L +// expected-warning@-2{{variable length arrays are a C99 feature}} +#endif } aaron.ballman wrote: > The di

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-09-01 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D132952#3761874 , @aaron.ballman wrote: > I'll ask on the WG14 reflectors to see if I'm interpreting the variably > modified type specification wrong or not. There's some agreement that the existing words could stand t

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-31 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D132952#3759731 , @efriedma wrote: > As a practical matter, there isn't any reason to force variably modified > parameters to make a function variably modified. The types of parameters > aren't visible in the caller of

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Matheus Izvekov via Phabricator via cfe-commits
mizvekov added a comment. In D132952#3759731 , @efriedma wrote: > As a practical matter, there isn't any reason to force variably modified > parameters to make a function variably modified. The types of parameters > aren't visible in the caller of a fu

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. As a practical matter, there isn't any reason to force variably modified parameters to make a function variably modified. The types of parameters aren't visible in the caller of a function; we only check the compatibility for calls. Trying to treat `void (*)(int, int

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D132952#3759398 , @efriedma wrote: > In D132952#3759226 , @aaron.ballman > wrote: > >>> We could theoretically mess with the AST representation somehow, but I >>> don't see any

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. In D132952#3759226 , @aaron.ballman wrote: >> We could theoretically mess with the AST representation somehow, but I don't >> see any compelling reason to. We probably just want to emit the >> warn_vla_used diagnostic somewhe

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. In D132952#3759109 , @efriedma wrote: >> We have the VariableArrayType to represent a VLA type and I think we're >> using that type when we should be using a variably modified type > > The clang AST for function signatures

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Eli Friedman via Phabricator via cfe-commits
efriedma added a comment. > We have the VariableArrayType to represent a VLA type and I think we're using > that type when we should be using a variably modified type The clang AST for function signatures encodes two types: the type as written, and the type after promotion. Semantic analysis a

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. Thank you for working on this! Can you be sure to add more information to the description so that reviewers more quickly understand why the changes are being made? In terms of the changes themselves, I don't think they're heading in the right direction just yet.

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread YingChi Long via Phabricator via cfe-commits
inclyc added inline comments. Comment at: clang/include/clang/Sema/Sema.h:1760 +// Special builder emitting no diagnostics +SemaDiagnosticBuilder(Sema &S) : S(S) {} SemaDiagnosticBuilder(Kind K, SourceLocation Loc, unsigned DiagID, erichkeane wrote:

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added inline comments. Comment at: clang/include/clang/Sema/Sema.h:1760 +// Special builder emitting no diagnostics +SemaDiagnosticBuilder(Sema &S) : S(S) {} SemaDiagnosticBuilder(Kind K, SourceLocation Loc, unsigned DiagID, I haven't look

[PATCH] D132952: [Sema] disable -Wvla for function array parameters

2022-08-30 Thread YingChi Long via Phabricator via cfe-commits
inclyc created this revision. inclyc added a reviewer: aaron.ballman. Herald added a project: All. inclyc added reviewers: rsmith, clang-language-wg. inclyc published this revision for review. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes: https://github.com/llvm/llv