News for hackers. Stuff that matters.
Re:Plan 9 Coding Conventions for C by to3m on Wednesday May 22, 2013 @11:56AM (#5751693)
I've seen it once, in 13 years of working professionally in C. I think two people changed the same one-line if statement, but for two different reasons (probably adding two different new features to the same bit of code). And after an automatic merge it became something like this:

    if(flag)
        set_other_flag=1;
        call_function();
(both lines necessary)

Anyway, it didn't take long to narrow it down to that bit of code but it took a few more minutes to figure out why the function was always getting called. I couldn't work out what was going on until I looked at the disassembly and was forced to reassess my opinion of what code was actually being compiled. Too much python in my diet, perhaps.

I remember being surprised at the time that it had taken so long for this to happen, and I made a mental note to keep an eye out for more occurrences. That was summer 2006, and I haven't seen it happen since.

There are no comments on this comment yet.