[Ecls-list] Fwd: Re: Re: latest cvs update fails on cygwin

Julian Stecklina der_julian at web.de
Mon Oct 23 01:48:31 UTC 2006


Brad Beveridge wrote:
> On 22/10/06, Juan Jose Garcia-Ripoll <jjgarcia at users.sourceforge.net> wrote:
>> 2006/10/22, Larry Clapp <larry at theclapp.org>:
>>>   static double
>>>   round_double(double d)
>>>   {
>>>           if (d > 0) {
>>>                   double q = floor(q + 0.5);
>> Ooops. Stupid typo. Funny that on four platforms it gave the right result :-/
> I imagine that you might have gotten lucky with the optimiser.  I'm
> guessing that "d" is passed in a register, and that register is
> accidentally preserved right through until the call to floor, the call
> to floor is possible inlined.

The thing that puzzles me is, whether the C syntax actually allows this.
Maybe I am thinking to CL-orientied, but to me this statement:

int p = (p = 1) + 5;

ought to signal an error, because p is undefined.

Another strange thing is that gcc does not even signal a warning with
statements like "double q = q;" without -O...

Regards,
Julian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 252 bytes
Desc: OpenPGP digital signature
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20061023/f84e72e0/attachment.sig>


More information about the ecl-devel mailing list