[squeak-dev] FloatMathPlugin status?

tim Rowledge tim at rowledge.org
Mon Feb 18 18:57:50 UTC 2013


On 18-02-2013, at 10:14 AM, Nicolas Cellier <nicolas.cellier.aka.nice at gmail.com> wrote:

> FloatMathPlugin uses fdlibm library.
> fdlibm library relies on pointer aliasing, which is Undefined Behavior
> according to C99 standard

Oh, well that sounds like it might cause fun.

> With -O2 optimization, gcc does not produce correct code with such
> pointer aliasing...
> A well known workaround is to compile fdlibm with -fno-strict-aliasing flag.

Wonder if that has any effect on the NorCroft RISC OS compiler. I'll give it a try.

It looked a bit odd to me that the generated plugin wants to rely on isnan() being a pretty specific routine in the fdlibm code and yet that is a pretty general macro defined in the basic C libraries. There is clearly an attempt in the .h file to work around that but surely you're asking for trouble by mixing two libraries with evidently differing ideas of what is the way to do things?

I think I'll try changing the isnan to something else so it can't clash and see what happens. If you see a big plume of smoke from the north west you'll know it didn't work...

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
Useful random insult:- One too many lights out in his Christmas tree.




More information about the Squeak-dev mailing list