Line comments versus line splicing [entries|reading|network|archive]
simont

[ userinfo | dreamwidth userinfo ]
[ archive | journal archive ]

Wed 2013-06-19 14:02
Line comments versus line splicing
LinkReply
[personal profile] simontThu 2013-06-20 08:06
Actually, I don't know what TDWTF article you might be referring to! (I drop in there occasionally, but not regularly, and I haven't seen this one.) Presumably this was somebody else having the //...\ problem in C++? The instance of that I was thinking of was from someone I know personally, who had written something along the lines of
    printf("complicated format string",
           arg1,
           arg2, // \
           arg3, //  } comment about these three
           arg4, // /
           arg5);
and got mysterious compiler warnings about the format string mismatching the parameters, which turned out to be because arg3 had been dropped on the floor. (Mystery eventually solved by using a later version of gcc, which helpfully gave a warning about the line-continued comment.)
Link Reply to this | Parent | Thread
[identity profile] deliberateblank.livejournal.comThu 2013-06-20 10:17
Yup. The story was this one:

http://thedailywtf.com/Articles/A-Bad-Leg.aspx

Which made a complete hash of telling the story, but is possible to figure out what was actually going on (and it fails just the same in gcc contrary to their telling), and surprised quite a few people reading it.
Link Reply to this | Parent
navigation
[ go | Previous Entry | Next Entry ]
[ add | to Memories ]