Is ‘int main;’ a valid C/C++ program?
I ask because my compiler seems to think so, even though I don’t. echo 'int main;' | cc -x c - -Wall echo 'int main;' | c++ -x c++ - -Wall Clang issues no warning or error with this, and gcc issues only the meek warning: 'main' is usually a function [-Wmain] , but only when compiled as C. Specifying a -std= doesn’t seem to matter. Otherwise, it compiles and links fine. But on execution, it terminates immediately with SIGBUS (for me). Reading through the (excellent) answers at What should main() return in C and C++? and a quick grep through the language specs, it would certainly seem to me that