Am I just a very bad coder or is this an abuse of C++ ?
-
Yeah, been there when porting code from Solaris to Linux back in around 1996.
The actual bug in that case was an overwrite of a function return address due to a one byte overflow caused by a misunderstanding of
fscanf
's%1s
pattern (as opposed to%c
) which was masked on big-endian architectures by the alignment of thechar
inside its word. Tracking that down was horrible, and the way it took out the debugger was particularly nasty as it ended up corrupting the crash dump itself…