This question on SO raised some comments about using undefined behaviour in C/C++ golfing. Should we require that solutions follow the standard? If we do, we could promote down-voting of solutions relying on undefined behaviour.

  • 2
    \$\begingroup\$ I'm torn. One the one hand, all's fair in love and code golf. On the other, I don't think it's right to exploit gratuitous compiler behaviour. \$\endgroup\$ Commented Jan 27, 2011 at 22:55

1 Answer 1


I expect people relying on unspecified, undefined, or compiler specific behavior to say so. Then, if I think it is gratuitous I just won't vote for their answer.

  • 4
    \$\begingroup\$ If this is so, we need to specify it in the faq. \$\endgroup\$
    – moinudin
    Commented Jan 28, 2011 at 0:03
  • \$\begingroup\$ Also, the undefined behaviour cannot be used as a backdoor to compromise people's computers. See this post for a discussion. \$\endgroup\$ Commented Feb 3, 2011 at 13:19
  • \$\begingroup\$ I like this solution. Why ban people from submitting solutions completely? If the community thinks a solution crosses a line in somewhat then they won't upvote it. \$\endgroup\$
    – Casey
    Commented Apr 29, 2011 at 1:12

Not the answer you're looking for? Browse other questions tagged .