Monday, October 24, 2005

Warning: No new line at end of file

Who's stupid idea was this? The HP-UX C++ compiler actually complains when you omit a newline at the end of a .cpp file. Why? What possible reason could there be?

Throughout the history of C it has been just about 100% white-space insensitive. C++ is pretty good in this respect too, except for nested templates (vector<pair<int,int>> will not work because the C++ syntax parser tries interpret >> as a shift rather than a close-template). But all of a sudden, the standard says you need newlines at the end of your source files.




Post a Comment

<< Home