Bus error on 32bit OSX, not 64bit
John Colvin
john.loughran.colvin at gmail.com
Mon Apr 15 10:56:33 PDT 2013
On Sunday, 14 April 2013 at 14:48:40 UTC, Jacob Carlborg wrote:
> This code:
>
> http://pastebin.com/U5XdFfDq
>
> Will result in a bus error when compiled as 32bit. Three ways
> the bus error won't happen:
>
> * If I compile as 64bit everything works fine
> * If the function "foo" is moved inline in the "main" function
> everything works fine
> * If store the return value of "fp" in "foo" in a temporary
> variable and then return it
>
> DMD 2.062
> Mac OS X 10.8.2
Casting a function that returns void to a function that returns
something seems bound to cause trouble. While it may be allowed
in C It seems a bit of a leap to assume that it would work
properly in D.
More information about the Digitalmars-d
mailing list