Bug Endian

I’m ashamed to admit that I got bitten by an endianess bug yesterday. It was just a small bug, in a test program, and didn’t affect IMLocation, but boy was my face ‘!der’

It made me realize I don’t test enough on PowerPC (PPC) systems, since I don’t own one anymore. (One of the joys of being a student developer is only having one computer).

So to simulate a PPC system on my intel box, I’ve started occasionally building for PowerPC only, and making sure everything still runs under Rosetta, OSX’s PPC emulator. You can get the same effect without rebuilding your application, if it is Universal, by selecting it in the Finder, choosing Get Info (⌘-I) -> “General” triangle -> checking “Open Using Rosetta”.

This isn’t a full substitute for testing on a real PPC Mac, of course. But it’s quick to do, catches some endian bugs, and gives you a bit more test coverage.

Explore posts in the same categories: Bugs, Programming, Tips

One Comment on “Bug Endian”


  1. [...] code has the same bug that bit me a few weeks ago — fourByteCodeString will return backwards strings on intel [...]


Comment: