[Swan-dev] -fno-strict-aliasing ?

D. Hugh Redelmeier hugh at mimosa.com
Sun Jun 5 18:19:15 UTC 2016


| From: Paul Wouters <paul at nohats.ca>
| 
| It seems compilation without -fno-strict-aliasing is working fine. I
| guess the old code that caused us to need to set this has been fixed
| or removed.
| 
| Is there any reason not to remove -fno-strict-aliasing from the default
| USERCOMPILE= setting?

We should try to follow C's aliasing rules.  But it is easy to slip.
If you do, the compiler can cause your program to do surprising things.
Unfortunately it is unlikely that the compiler would tell you when
this has happened.

I would think and hope that our code would survive without
-fnon-strict-aliasing.  But to prevent surprises, it might be worth
keeping -fno-strict-aliasing anyway.


More information about the Swan-dev mailing list