No comment.....
-
I'm not entirely sure what one of my collegues is thinking today actually. somewhere along the line he managed to check in a c++ source file with a missing end tag on a block comment. Then realises his mistake and corrects it.
Only fair he lets us know what his last change was, right?
let's look at the change log at the top of the file...
/************************************
* <usual copyright stuff>
* Changes
* - Fixed missing */ from end of comment
* <other fixes>
*
************************************/
umm... nope. Try again.
-
Is that comment auto-generated (from a comment manually typed into the source control software) or was it manually typed into the source itself?
-
I think that's probably the WTF here - it is from an automated checkin script - which he himself wrote
-
@blatant_mcfakename said:
I think that's probably the WTF here - it is from an automated checkin script - which he himself wrote
TBH, if that's the case I wouldn't consider it much of a WTF, unless the script itself has blatant WTFs. He just never tested for such edge-cases, I for one would have never expected the requirement that a multi-line C-style comment block require the trailing */
-
@Lingerance said:
I for one would have never expected the requirement that
FTFYa multi-line C-style comment block require the trailingan inline */ be escaped
-
@Zecc said:
I was actually referring to the bug that prompted that comment to appear. But w/e.@Lingerance said:
I for one would have never expected the requirement that
FTFYa multi-line C-style comment block require the trailingan inline */ be escaped
-
-
@blatant_mcfakename said:
Fixed missing \*/ from end of comment
Oh, yeah. Gotta escape that asterisk.
-
@bstorer said:
No, you idiot. I meant escaping like this:@blatant_mcfakename said:
Fixed missing \*/ from end of comment
Oh, yeah. Gotta escape that asterisk.#include <stdio.h>
/*
* I'm putting a ✱/ right here in this comment.
*/
int main( int argc, char *argv[] )
{
printf("Hello world\n");
return 0;
}
-
It took me a while to realize what was wrong with this, but then... HAHA!
-
@Arancaytar said:
It took me a while to realize what was wrong with this, but then... HAHA!
Me too. And then I felt very stupid.
-
@toth said:
@Arancaytar said:
It took me a while to realize what was wrong with this, but then... HAHA!
Me too. And then I felt very stupid.
Yah, me three. Fortunately, I always feel pretty stupid, so very stupid isn't much of a jump.
-
int main() {
// WhyTF does this print nothing???????/
printf("Hello world!\n");
return 0;
}
-
@Abdiel said:
// WhyTF does this print nothing???????/
printf("Hello world!\n");Ahh, trigraphs. For all those times you have to code C but you don't have a keyboard capable of handling the complexities of ASCII.
-
@Abdiel said:
Your code hits a -Wall:int main() {
// WhyTF does this print nothing???????/
printf("Hello world!\n");
return 0;
}trig.c:2:40: warning: trigraph ??/ ignored, use -trigraphs to enable
Then it prints "Hello World" as I'd've expected.
trig.c: In function ‘main’:
trig.c:3: warning: implicit declaration of function ‘printf’
trig.c:3: warning: incompatible implicit declaration of built-in function ‘printf’
-
This is one of the reasons why typical coding polcies forbid both multi-line comments and trigraphs.
-