在使用gcc编译代码时出现了一个warning,no newline at end of file ,具体原因是因为在文件尾必须的新增一行空行,以避免include文件时,展开后与后面的文件连为一行,造成错误。C++文档中有明确说名。唉,vs就从来没有提醒过,难道是换行符的区别?
A source file that is not empty and that does not end in a new-line character, or that ends in a new-line character immediately preceded by a backslash character before any such splicing takes place, shall be processed as if an additional new-line character were appended to the file (C++11 §2.2/1)