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:
Thanks,Pavan Deolasee <pavan.deolasee@gmail.com> writes:Any such behavior is patently illegal per the C standard.
> Can some kind of compiler optimisation reorder things such that the "else
> if" expression is evaluated using the old, uninitialised value of optval?
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.
В списке pgsql-hackers по дате отправления: