`'`/`"` on `//` line can start string parsing
// '
fails with Unterminated string.
// "
Fails with the same message.
Adding a second // ' or ' after the first does not fail.
This isn't a big deal, but it will cause weird failures if single line comments are used and somebody writes don't or something else that uses the apostrophe.
This is because of how // is tokenized. Because of the // CONSTANT 1 syntax anything after // is tokenized like normal.
This can be used for a rather fun exploit where you can arbitrarily remove code in a very unintuitive way.
For example, the following program will always return 1 and the output will not have an if statement in it.
int main() {
int a = 0;
// Will always happen, so wont't need rest of function
if(a == 0) return 0;
// Won't happen
return 1;
}
This behavior is also present in at least cc_amd64 and most likely all other cc_* compilers.