Hi there!

This e-mail thread and all the examples are about "Foo**" -> "const Foo *
const * const" conversion, from the very beginning through all the examples.
Here is the code snippet from the original request I posted:
"
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!!!*

}".
Not "const Foo** const", not "const Foo**", not "Foo*const*", but about
"Foo**" -> "const Foo * const * const" conversion.

Two responses ago, you're just started explaining that "const Foo * const *
const" type is very similar to "const Foo * const *". Thank you.
But I don't know how it is related to the original topic and how it might
be related to all the stuff, including compiler options, GCC 14.1 changes
being discussed e.t.c.
And you're the only person who is trying to explain me that "const Foo *
const * const" type is very similar to "const Foo * const *".

Respectfully,
Aleksandr G Povaliaev.



ср, 10 дек. 2025 г. в 18:04, Andrey Tarasevich <[email protected]>:

> > On 12/10/2025 4:58 AM PST Александр Поваляев via Gcc-help <
> [email protected]> wrote:
> > We considered some examples (both passing through function parameter and
> > assignment) where "Foo**" -> "const Foo * const * const" conversion might
> > happen.
>
> What we are collectively trying to teach you here, is some obscure but
> _very_ _relevant_
> basic facts about C language. And the specific piece of knowledge we are
> focusing on now
> (and have been trying to convey to you for quite a while) is the fact that
> when you pass
> an argument of type `Foo **` to function whose parameter is declared as
> `const Foo * const * const`,
> the implicit conversion the language will be trying to apply is a
> conversion to
> `const Foo * const *` type (note: no trailing `const`). Conversions with
> top-level `const`
> simply do not exist in C.
>
> So, if you will be spelling this conversion out explicitly (as a cast),
> which is exactly
> what we were talking about it just might make more sense to spell out the
> same conversion
> the C language itself would use: a conversion to `const Foo * const *`. It
> is just shorter.
>
> This little important detail is something you seem to be having trouble
> getting since
> the very start. But there's no other way around. You are going to have to
> make an effort
> and get it, if you want to understand the matter at hand.
>
> > I am not sure about the examples you have just mentioned. I am not sure
> > they are very rare and it looks like they (examples) are a little bit
> > irrelevant to the subject matter being discussed within this e-mail
> thread.
>
> The examples are relevant in a sense that they are here to teach you
> something
> you seem to have trouble understanding even after multiple repetitive
> attempts with
> more convoluted examples. The examples are designed to be very simple,
> they are basically
> an application of "explain it with sock puppets" technique. And you don't
> get to doubt
> them. You get to study them attentively and ask polite questions if
> something is
> still unclear to you.
>
> Otherwise, there's no hope for you to understand the matter. In that
> unfortunate case
> we'll just have to file it under "H" for "hopeless".
>
> --
> Best regards,
> Andrey
>

Reply via email to