Re: Is this code safe?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Is this code safe?
Date: 2014-08-28 05:50:51
Message-ID: 15948.1409205051@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)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. Not that that's
always stopped compiler writers; but I think you might be looking at a
compiler bug. We'd need more context about the exact platform, compiler,
etc.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fabien COELHO 2014-08-28 06:27:26 Re: postgresql latency & bgwriter not doing its job
Previous Message Pavan Deolasee 2014-08-28 05:43:05 Is this code safe?