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)
Список
Дерево обсуждения
[HACKERS] Add some const decorations to prototypes Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] Add some const decorations to prototypes Mark Dilger <hornschnorter@gmail.com>
Re: [HACKERS] Add some const decorations to prototypes Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Add some const decorations to prototypes Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] Add some const decorations to prototypes Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Add some const decorations to prototypes Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] Add some const decorations to prototypes Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] Add some const decorations to prototypes Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] Add some const decorations to prototypes Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] Add some const decorations to prototypes Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Add some const decorations to prototypes Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] Add some const decorations to prototypes Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] Add some const decorations to prototypes Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] Add some const decorations to prototypes Fabien COELHO <coelho@cri.ensmp.fr>
Re: [HACKERS] Add some const decorations to prototypes Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Re: [HACKERS] Add some const decorations to prototypes Robert Haas <robertmhaas@gmail.com>
> 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
// 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 по дате отправления
От: Tom Lane
Дата: