Re: A: a new bug to old plain C
Simon Richter <[email protected]>
| Newsgroups | gmane.comp.gcc.help |
|---|---|
| Message-ID | <[email protected]> |
Hi,
On 11/26/25 3:14 PM, Александр Поваляев via Gcc-help wrote:
> Could somebody point out where in the C standard a conversion "Foo**" ->
> "const Foo * const * const" is prohibited?
It's disallowed because
void foo(int const *const p)
{
int *nonconst_p;
int *const *const pp = &nonconst_p;
*pp = p;
*nonconst_p = 42;
}
would allow overwriting a variable passed in as pointer-to-const.
Simon