With this code:
#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; \
} \
}
I get a warning: backslash-newline at end of file
Any idea how to make it go away?
David
Open the file in an editor, go to the last line of the file, and hit enter to add a blank line to the end of the file. Though, besides that, you should be using #include <iostream> instead of <iostream. h> . Then put in a using std::cout; after it.
A backslash before a newline indicates that the next line is a continuation, as if the newline wasn't there (particularly useful for #define which would normally be on one line).
Solution: The backslash (\) character is used as the continuation character to continue #define statements and strings to the next line. GCC expects the backslash character to be the very last character on the line.
The problem is that there's no new-line character in the end of your code. C++ Standard §2.1/2 says:
<...>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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With