]> git.ipfire.org Git - thirdparty/gcc.git/commit
c: harmonize handling of arrays
authorMartin Uecker <uecker@tugraz.at>
Wed, 3 Jun 2026 15:57:30 +0000 (17:57 +0200)
committerMartin Uecker <uecker@gcc.gnu.org>
Thu, 4 Jun 2026 20:46:54 +0000 (22:46 +0200)
commit106970adca69c9c577e6c75f4e69a08cd9ea2df0
tree4076d97862e1c6d4133b6b095eb916c2e06f887a
parenteaf4292c83804bd21b920db174401ca3702601d4
c: harmonize handling of arrays

This code harmonizes the handling of arrays in C by consistently
using build_index_type instead of build_range_type when creating
arrays and using top_array_vla_p to detect top-level VLAs.

gcc/c-family/ChangeLog:
* c-common.cc (complete_array_type): Use build_index_type.
* c-ubsan.cc (ubsan_instrument_bounds_pointer_address): Likewise.

gcc/c/ChangeLog:
* c-decl.cc (grokdeclarator): Likewise.
* c-typeck.cc (c_verify_type,c_build_array_type,
c_expr_countof_expr,comptypes_internal): Use top_array_vla_p.
(top_array_vla_p): Rename to use _p convention and simplify.
gcc/c-family/c-common.cc
gcc/c-family/c-ubsan.cc
gcc/c/c-decl.cc
gcc/c/c-typeck.cc