数据加载中……

【原创】warning no newline at end of file 的解决办法

在使用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)










posted on 2013-06-27 13:44 Stone xin 阅读(1060) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   博问   Chat2DB   管理