"Arne Schmitz" <ar**********@gmx.net> wrote in message
news:42*************@news.dfncis.de...
Jim Langston wrote:
"baibaichen" <ba********@gmail.com> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com... no, ,just vc do not issue this warning.
however, there should be a potential problem if we miss newline...
I don't see how there could possibly be a problem if VC handles it.
http://gcc.gnu.org/ml/gcc/2001-07/msg01120.html
Arne
I just tested that in msvc++ .net 2003 and it compiles without problem.
File iostreamtest.h:
#include <iostream>
(no newline at end)
File stringtest.h:
#include <string>
(no newline at end)
File main.cpp:
#include "iostreamtest.h"
#include "stringtest.h"
int main()
{
std::string test = "Hello";
std::cout << test;
std::string Wait;
std::cin >> Wait;
}
Compiles and outputs Hello
Again, the compiler handles that. It probably just includes an extra
newline for include files.
So, since the compiler handles there not being no newlines at the end of a
file, it doesn't seem to be an issue so doesn't need a warning.