Re: [HACKERS] Add some const decorations to prototypes - Mailing list pgsql-hackers

From Fabien COELHO
Subject Re: [HACKERS] Add some const decorations to prototypes
Date
Msg-id alpine.DEB.2.20.1711101626180.668@lancre
Whole thread Raw
In response to Re: [HACKERS] Add some const decorations to prototypes  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: [HACKERS] Add some const decorations to prototypes
List 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 by date:

Previous
From: Fabien COELHO
Date:
Subject: Re: [HACKERS] Add some const decorations to prototypes
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Simplify ACL handling for large objects and removal of superuser() checks