I love this quote by Carl Ek from Code Integrity solutions:
There are 0010 0000 kinds of people in the world: Those that understand the difference between Big Endian and Little Endian, and those that do not.
Issues with Endianism and processor architecture ports are becoming more and more common these days as more desktop source code moves into different arenas. Gone are the days when the 32-bit memory model or little-endian format dominate. Software changes are required to support the growth occurring not at the desktop, but in the server and mobile platforms.
Mobile devices especially have opened a Pandora’s box of Endian and memory problems, with variety of processor architectures with ARM[1] leading the way. Add to this mix, end-consumers are demanding desktop features like Adobe Flash or Office apps on mobile devices, many a stable codebase will fall apart when ported to either mobile or server.
For developers porting to different platforms, there are some significant challenges. Just to list a few:
- CPU optimizations need to be reviewed
- inline assembly calls require rewriting or removal
- machine word (WORD) allocations may require refactoring
- any binary data exchanged over the network stacks require verification
None of these are new, they’re just not a common skillset for most developers.
Source code analysis can be a boon in two ways. Firstly, in the planning phase by helping you determine the breadth of the effort, and secondly by identifying any existing issues, particularly of the memory allocation and Endian varieties.
For more in depth information, there are two recent articles available from Dr. Dobbs:
- Porting to 64-bit Platforms by Irving Rabin
- Detecting Endian Issues with Static Analysis Tools by Carl Ek
[1] Note: Some ARM processors support both big and little Endian formats.
Related posts:
- Porting gotchas
- Developer productivity – you’ve got mail
- The Evolution of Source Code Analysis – Part 2: The Early 21st Century
Tags: big endian and little endian, memory model, network stacks, porting, processor architecture, source code analysis

[...] This post was mentioned on Twitter by Klocwork, Ahmed M. Dirie. Ahmed M. Dirie said: 0010 0000 or 0000 0010 which one are you? http://ow.ly/2phGL [...]
Related topic: Pattern 11. Serialization and data interchange – http://www.viva64.com/lessons-x64/19_Pattern_11_Serialization.html
[...] provide data interaction with the target processor in the proper endian format. Here’s a good post that talks about this issue in more details, and references a bunch of good third party articles, [...]
[...] We also tried to collect a bunch of other resources on this topic in one spot with a previous endian blog post we [...]