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.

Advertisements
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 […]


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: