Re: Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit.

Поиск
Список
Период
Сортировка
Искать
От
Kevin Grittner
Тема
Re: Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit.
Дата
Msg-id
4D5D0C85020000250003ABAC@gw.wicourts.gov
Ответ на
Список
Дерево обсуждения
Re: Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit. Tom Lane <tgl@sss.pgh.pa.us>
Re: Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit. Andrew Dunstan <andrew@dunslane.net>
Re: Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit. "Kevin Grittner" <Kevin.Grittner@wicourts.gov>
Re: Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit. Andrew Dunstan <andrew@dunslane.net>
Andrew Dunstan  wrote:
> Ugh. Isn't there some sort of pragma or similar we can use to shut
> it up?
If that fails, maybe use some function like the below?  That would
also have the advantage of not relying on assumptions beyond the
documented API, which I tend to feel good about no matter how sure I
am that the implementation details upon which I'm relying won't
change.
No claims that this is good final form, especially when it comes to
using ssize_t, but just trying to get across the general idea:
void
write_completely_ignore_errors(int filedes, const void *buffer,                              size_t size)
{   size_t t = 0;   while (t < size)   {       ssize_t n = write(filedes, buffer, size - t);       if (n <= 0)           break;       t += n;   }
}
-Kevin

В списке pgsql-hackers по дате отправления
От: Bruce Momjian
Дата:
От: Bruce Momjian
Дата:
FAQ