Re: [HACKERS] Add some const decorations to prototypes
От | Fabien COELHO |
---|---|
Тема | Re: [HACKERS] Add some const decorations to prototypes |
Дата | |
Msg-id | alpine.DEB.2.20.1711101626180.668@lancre обсуждение исходный текст |
Ответ на | Re: [HACKERS] Add some const decorations to prototypes (Fabien COELHO <coelho@cri.ensmp.fr>) |
Ответы |
Re: [HACKERS] Add some const decorations to prototypes
|
Список | pgsql-hackers |
> Would it make sense that the function returns "const void *", i.e. the cast > is not on the const part but on the pointer type part? Or maybe you do not really need a cast, the following code does not generate any warning when compiled with clang & gcc. #include <stdio.h> // const void * would be ok as well void * msg_fun(void) { return "hello world"; } int main(void) { const char * msg = msg_fun(); printf("message: %s\n", msg); return 0; } Or basically all is fine, I'm just nitpicking for nothing, shame on me. As I said, I rather like more precise declarations. -- Fabien. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers
В списке pgsql-hackers по дате отправления: