Re: Is this code safe?

Поиск
Список
Период
Сортировка
От Pavan Deolasee
Тема Re: Is this code safe?
Дата
Msg-id CABOikdO4ZaE-T_x-DDuFCTb1fN1LVX_C3=d_Hxtm0dT9XBNhOg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Is this code safe?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

On Thu, Aug 28, 2014 at 11:20 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
Pavan Deolasee <pavan.deolasee@gmail.com> writes:
> Can some kind of compiler optimisation reorder things such that the "else
> if" expression is evaluated using the old, uninitialised value of optval?

Any such behavior is patently illegal per the C standard.

Thanks a lot for explaining that. 
 
  Not that that's
always stopped compiler writers; but I think you might be looking at a
compiler bug.

I'd requested the reporter to try moving the getsockopt() call outside "if" expression. That hasn't helped. So I think its a case of getsockopt() neither returning an error nor setting optval to any sane value. Will try to get more details about the platform etc.
 
Thanks,

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

Предыдущее
От: Fujii Masao
Дата:
Сообщение: Re: [Fwd: Re: proposal: new long psql parameter --on-error-stop]
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: re-reading SSL certificates during server reload