Consider this C code:
#include <stdio.h>;
int main(void) {
puts("Hello, world!");; ;
;
return 0; ;
; ;
};
Here I've put semicolons almost everywhere possible. Just for fun. But surprisingly it worked! I got a warning about the semicolon after include but other absolutely wrong semicolons worked. If I forget to put a semicolon after puts
, I'll get the following error
error: expected ';' before 'return'
Why don't lots of wrong and useless semicolons cause errors? To my mind they should be treated as syntax errors.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…