Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Portability of Misaligned Data Access . . . . . . . (was Re: issues with format of double (or IEEE754))



On 27/07/06, Jim <jep200404@example.com> wrote:

It makes me think about the portability of some of the stuff
I've written. Most runs on Intel trash, which seemingly
tolerates misaligned data, but such programs might puke
when running on non x86 family CPUs.

Indeed. SUN4U processors (and probably most SPARC processors, I would
imagine) tend to spew bus errors if integers are not aligned on a
four-byte boundary.

I found this out the hard way when I moved a ISDN trunk control daemon
that I wrote, which had been running happily on an Intel box running
Linux, to a SUN4U box running Solaris 8.

And, as luck would have it, the bug was not exposed unless there were
something like any multiple of three simultaneous calls. That one had
me scratching my head and Googling like a madman! :)

-Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links