On tis, 2012-01-10 at 14:10 -0500, Alex Goncharov wrote:
> | Note that const PGresult * would only warn against changing the
> | fields
> 
> It would not warn, it would err (the compilation should fail).

No, const violations generally only produce warnings.

> 
> | of the PGresult struct.  It doesn't do anything about changing the data
> | pointed to by pointers in the PGresult struct.  So what you are saying
> | doesn't follow.
> 
> By this logic, passing 'const struct foo *' doesn't have any point and
> value, for any function.

It pretty much doesn't.

> But we know that this is done (and thank you
> for that) in many cases -- a good style, self-documentation and some
> protection.

I'm not disagreeing, but I'm pointing out that it won't do what you
expect.



-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to