Re: A: a new bug to old plain C

Chris S via Gcc-help <[email protected]>
Newsgroups gmane.comp.gcc.help
Message-ID <CACQ7eL45sDTXFB62CFnMv1OVFSk__P=EN6ERm0-VZ+xJ_q3DVA@mail.gmail.com>
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 <
[email protected]> 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.
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.