Re: Question about ECPGset_noind_null() and ECPGis_noind_null()

From: Boszormenyi Zoltan <zb(at)cybertec(dot)at>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Michael Meskes <meskes(at)postgresql(dot)org>, pgsql-hackers(at)postgresql(dot)org, Hans-Juergen Schoenig <hs(at)cybertec(dot)at>
Subject: Re: Question about ECPGset_noind_null() and ECPGis_noind_null()
Date: 2009-11-19 21:00:52
Message-ID: 4B05B204.2000400@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane írta:
> Andrew Dunstan <andrew(at)dunslane(dot)net> writes:
>
>> Boszormenyi Zoltan wrote:
>>
>>> Is it *really* a bug? I recalled a comment from my C teacher
>>> in '92 or '93 about this exact issue, that the prefix/postfix
>>> increment/decrement operators are executed in the
>>> statement in an implementation-defined order,
>>>
>
>
>> Not if they come after a short-circuit operator such as && - after all,
>> that's what short-circuit evaluation implies. If the left hand operand
>> of && is false the right hand should not be evaluated at all.
>>
>
> Yes. && is a sequence point and the compiler is not allowed to move
> side-effects across a sequence point. What your C teacher was warning
> you against was things like
> a[i] = i++;
> '=' is not a sequence point so it's undefined which array index
> will be stored into.
>
> regards, tom lane
>

Thanks to both of you, this was really informative.
Actually my C teacher didn't mention such optimization barriers.
It seems I need to look up the raw C language specs...

Best regards,
Zoltán Böszörményi

--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Emmanuel Cecchet 2009-11-19 21:21:43 Union test case broken in make check?
Previous Message Heikki Linnakangas 2009-11-19 20:54:18 Re: Architecture of walreceiver (Streaming Replication)