For the want of a pipe


We’ve been fighting a bug for the past few weeks, one of the worst kinds. Not a viral physical kind, but a cybernetic kind. It’s intermittent, and only pops up in something like 0.01% of the time. Turns out (the brilliant programmer I’m working with found it, not me) that in the 11,000 or so lines of code in the project, we were missing a ‘|’, the thing between the single quotes. It’s the pipe symbol… for you C programmers out there, you’d recognize that:


#define X 1
#define Y 2
int abc = X;
abc = Y;

gives you radically different results than


#define X 1
#define Y 2
int abc = X;
abc |= Y;

Good thing this wasn’t code running a satelite, like this guy writes about.


Comments are closed.