diff options
author | Martin Uecker <uecker@tugraz.at> | 2025-07-27 17:58:14 +0200 |
---|---|---|
committer | Martin Uecker <uecker@gcc.gnu.org> | 2025-08-02 09:06:49 +0200 |
commit | 09a3da82125e07da504136841d577f103aa4ea13 (patch) | |
tree | d384009ac1cf8d61e5388d8c627e98560a49d9d3 /contrib/gcc-changelog/git_commit.py | |
parent | 3e4ced9de1f1c6444eae44c1fed493742c345bc6 (diff) | |
download | gcc-09a3da82125e07da504136841d577f103aa4ea13.zip gcc-09a3da82125e07da504136841d577f103aa4ea13.tar.gz gcc-09a3da82125e07da504136841d577f103aa4ea13.tar.bz2 |
c: rewrite implementation of `arg spec' attribute
Rewrite the implementation of the `arg spec' attribute to pass the the
original type of an array parameter instead of passing a string description
and a list of bounds. The string and list are then created
from this type during the integration of the information of `arg spec'
into the access attribute because it still needed later for various
warnings. This change makes the implementation simpler and more robust
as the declarator is not processed and information that is already encoded
in the type is not duplicated. A similar change to the access attribute
could then completely remove the string processing. With this change, the
original type is now available and can be used for other warnings or for
_Countof. The new implementation tries to be faithful to the original,
but this is not entirely true as it fixes a bug in the old implementation.
gcc/c-family/ChangeLog:
* c-attribs.cc (handle_argspec_attribute): Update.
(build_arg_spec): New function.
(build_attr_access_from_parms): Rewrite `arg spec' handling.
gcc/c/ChangeLog:
* c-decl.cc (get_parm_array_spec): Remove.
(push_parm_decl): Do not add `arg spec` attribute.
(build_arg_spec_attribute): New function.
(grokdeklarator): Add `arg spec` attribute.
gcc/testsuite/ChangeLog:
* gcc.dg/Warray-parameter-11.c: Change Warray-parameter to
-Wvla-parameter as these are VLAs.
* gcc.dg/Warray-parameter.c: Remove xfail.
Diffstat (limited to 'contrib/gcc-changelog/git_commit.py')
0 files changed, 0 insertions, 0 deletions