Just wrote this. Luckily it got caught as a warning, otherwise it'd have been really annoying. Just so you know, [font=courier new,courier,monospace]name[/font] is a const char*. for (unsigned len = 0; *name; len++, *name++) {
Why is ++ allowed on a const value? I'd like to say that maybe it's because the return value is modified, but it's a post-increment (so the original value would be returned) and even then there are other easy ways to approach that (e.g. the + operator). Take into account this is C, not C++, so there isn't any wacky overloading going on (and even then, it's a char...). Moreover, it's being compiled with -std=c99, so extensions are disabled.
(and before you ask, no, I wasn't reinventing strlen, the loop code does more than just counting characters)
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.
Derp, and the most ironic is that I had remembered that syntax specifically (since it matches one of 68000's addressing modes). I wonder what was I thinking when I wrote that post.
Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.
C#: I was hunting down a bug, so went in and set a conditional breakpoint deep in the bowels of this data access code
entity.Location = "http://....somebiglongstring.html"
And then went to lunch. Came back and bug was still there, but the breakpoint wasn't hit. Rebuilt, redeployed and still a bug. Nobody else got the bug though, and it worked fine in release mode. Step throught the code... data model entity goes into the translator, view model comes out with the wrong location...
Took me 2 days to find the conditional breakpoint which will do the assignment, and will never actually trigger since assignment isn't "true".
Why would it fail? Wouldn't it just do nothing? Or is it because v.size()-1 presumably is unsigned since it's being compared against a size_t so it would run MAX_INT times?