Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Trigraph trickery
/* Always change a */
// Do we need to change a??/
if(aChanged)
foo->a = a;
/* Never change a */
// Do we need to change a??/
if(aChanged) foo->a = a;
@itkovian

This comment has been minimized.

Copy link

@itkovian itkovian commented Mar 30, 2012

This is why // should not be used :-)

@wvdschel

This comment has been minimized.

Copy link
Owner Author

@wvdschel wvdschel commented Mar 30, 2012

This is why trigraphs should no longer be allowed and the compiler should warn against them. I'm OK with single line comments using //.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment