On 11/10/17 11:42, Fabien COELHO wrote:
> After your explanation, and on third thoughts, ISTM that the assignment
> should not include "const" in the explicit cast, i.e., use
>
> extern void * msg_func(void);
> const char * msg = (char *) msg_func();
>
> The variable or field is constant, not what the function returns, so
>
> const char * msg = (const char *) msg_func();
>
> does not really make full sense to me, and moreover the compiler does not
> complain without the const.
The compiler knows how to handle the char * -> const char * case, but
not the char ** -> const char ** case.
--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers