Re: libpq: PQcmdStatus, PQcmdTuples signatures can be painlessly improved

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: libpq: PQcmdStatus, PQcmdTuples signatures can be painlessly improved
Дата
Msg-id 1326657121.32048.3.camel@vanquo.pezone.net
обсуждение исходный текст
Ответ на Re: libpq: PQcmdStatus, PQcmdTuples signatures can be painlessly improved  (Alex Goncharov <alex-goncharov@comcast.net>)
Список pgsql-hackers
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.




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Joachim Wieland
Дата:
Сообщение: patch for parallel pg_dump
Следующее
От: Gabriele Bartolini
Дата:
Сообщение: Re: Dry-run mode for pg_archivecleanup