Richard Guenther <richard.guent...@gmail.com> writes:

> For
>
> extern const char **f1();
> void f(char *p)
> {
>   *(char **)f1() = p;
> }
>
> it warns with
>
> t.C: In function ‘void f(char*)’:
> t.C:4: warning: cast from type ‘const char**’ to type ‘char**’ casts
> away constness
>
> which makes sense.

This is actually a safe operation, you can even store safely into
**(char **)f1() afterwards.

Andreas.

-- 
Andreas Schwab, sch...@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

Reply via email to