Re:Why 1 && 2 == 2
by chewxy on Thursday July 18, 2013 @11:46PM
(#6068209)
Nah mate, it's just some compiler flag that I didn't turn on (don't know which. my gcc-fu is fail since it's been really a long time since I touched C)
[ Parent
| on HN ]
Just for my curiosity's sake, would you mind posting the code you tried that segfaulted?
Re:Why 1 && 2 == 2
by georgemcbay on Thursday July 18, 2013 @11:54PM
(#6068242)
Yeah I'm dying to see the original C code but it isn't on the page anywhere, AFAICT.
From the article, about the C version: "Mine hadn't worked, which I suspect is some sort of compiler issue."
Yeah I'm going to go out on a limb and proclaim that there's no way this was due to a compiler "issue" in gcc. Not that gcc is perfect, but there's no way it is barfing on one of these handful of line programs that does nothing but some logical operations and printfs.
Nope. The answer is still I suck at C.
Parts of the blog post was written late last night (about 3 am), and parts of it was written on my commute to work. I tried to rewrite what I wrote last night and tried to compile it on my work computer, and all I got were warnings.
So... can't recreate. Sorry
My thoughts too.
It's not a compiler flag, I guarantee it. Your code was simply incorrect. The only thing a compiler flag might have done was turn on a warning that would have told you what you did wrong (depending on what, exactly, you did do wrong).