A: a new bug to old plain C
Chris S
cs2991@gmail.com
Fri Nov 21 03:23:49 GMT 2025
You're applying two consts to the same thing, so it's an error.
"Const int" and "int const" are the same (look up East vs West const), but
"const int const" is an error. Declaring a pointer to that invalid type
declaration is still invalid.
On Thu, Nov 20, 2025, 5:27 PM Александр Поваляев via Gcc-help <
gcc-help@gcc.gnu.org> wrote:
> struct zzz {
> unsigned x, y;
> };
>
> void square(struct zzz ** arr_of_ptr, unsigned count) {
>
> *// The first "const" produce an error (not a warning) within some GCC
> toolchains, for example ARM GCC trunk (linux), see goldbolt.org
> <http://goldbolt.org>*
> struct zzz const * const * const end_of_arr = arr_of_ptr + count;
>
> *// Without the first const "struct zzz * const * const end_of_arr =
> arr_of_ptr + count;" it works fine!!!*
>
> }
>
> Respectfully,
> Aleksandr G Povaliaev.
>
More information about the Gcc-help
mailing list