Re: new compiler warnings

Поиск
Список
Период
Сортировка
Искать
От
Robert Haas
Тема
Re: new compiler warnings
Дата
Msg-id
CA+TgmoYsrpCZiPkomfZuHoanhT+v0mX57QhoCMt0mJZ8odXAnA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Andrew Dunstan <andrew@dunslane.net>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings Peter Eisentraut <peter_e@gmx.net>
Re: new compiler warnings Robert Haas <robertmhaas@gmail.com>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Robert Haas <robertmhaas@gmail.com>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings Robert Haas <robertmhaas@gmail.com>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Andrew Dunstan <andrew@dunslane.net>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Robert Haas <robertmhaas@gmail.com>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings Peter Eisentraut <peter_e@gmx.net>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings Peter Eisentraut <peter_e@gmx.net>
Re: new compiler warnings Robert Haas <robertmhaas@gmail.com>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Greg Stark <stark@mit.edu>
Re: new compiler warnings "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: new compiler warnings Tom Lane <tgl@sss.pgh.pa.us>
Re: new compiler warnings Robert Haas <robertmhaas@gmail.com>
On Tue, Oct 18, 2011 at 12:26 PM, Tom Lane  wrote:
> Robert Haas  writes:
>> On Tue, Oct 18, 2011 at 10:06 AM, Peter Eisentraut  wrote:
>>> No, I believe we are OK everywhere else.  We are only ignoring the
>>> result in cases where we are trying to report errors in the first place.
>
>> The relevant code is:
>
>>     while (len > PIPE_MAX_PAYLOAD)
>>     {
>>         p.proto.is_last = (dest == LOG_DESTINATION_CSVLOG ? 'F' : 'f');
>>         p.proto.len = PIPE_MAX_PAYLOAD;
>>         memcpy(p.proto.data, data, PIPE_MAX_PAYLOAD);
>>         write(fd, &p, PIPE_HEADER_SIZE + PIPE_MAX_PAYLOAD);
>>         data += PIPE_MAX_PAYLOAD;
>>         len -= PIPE_MAX_PAYLOAD;
>>     }
>
>> Which it seems to me we could change by doing rc = write().  Then if
>> rc <= 0, we bail out.  If not, we add and subtract rc, rather than
>> PIPE_MAX_PAYLOAD.  That would be barely more code, probably safer, and
>> would silence the warning.
>
> And it would break the code.  The whole point here is that the message
> must be sent indivisibly.

How is that different than the chunking that the while loop is already doing?

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

В списке pgsql-hackers по дате отправления
От: Fujii Masao
Дата:
От: Simon Riggs
Дата:
FAQ