在文件末尾的反斜杠换行符警告 [英] Backslash newline at end of file warning
本文介绍了在文件末尾的反斜杠换行符警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用此代码:
#include <iostream>
int main(int argc, char *argv[])
{
return 0;
}
/** run2: A macro to call a function. */
#define run2( function, ctype, dim ) \
if ( operation == #function ) \
{ \
if ( componentType == #ctype && Dimension == dim ) \
{ \
typedef itk::Image< ctype, dim > ImageType; \
function< ImageType >( inputFileName, outputFileName, radius, algorithm, useCompression ); \
supported = true; \
} \
}
我收到一条警告:backslash-换行符到文件末尾
I get a warning: backslash-newline at end of file
任何想法如何使它消失?
Any idea how to make it go away?
David
推荐答案
问题是代码末尾没有换行符。 C ++标准版; 2.1 / 2说:
The problem is that there's no new-line character in the end of your code. C++ Standard §2.1/2 says:
< ...>如果一个不是
empty的源文件不是以新行
字符结束,或者以换行符
结束,之后是
反斜杠字符,行为是
未定义。
<...>If a source file that is not empty does not end in a new-line character, or ends in a new-line character immediately preceded by a backslash character, the behavior is undefined.
这篇关于在文件末尾的反斜杠换行符警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文