Using the below pragma
#pragma warning disable = 329
warning C329: single-line comment contains line-continuation
Interesting - but you will just fix your code, won't you...?
Probably not. The lines that the compiler's complaining about are comments. These particular comments are in a file that converts raw A/D values into meaningful sensor values, and are ASCII text drawings of the sensor circuitry. For example, consider this type of comment block:
// |\ X1 AMP // | // +---| +---[TP] // | | / // | |/
Boy... that didn't show up in the forum that way it looked when I pasted it into my reply! Can't seem to get the forum to display leading spaces in front of my primitive drawing char's, whether I use the pre /pre markers or not. The bottom line is that I have a comment of the '//' type, and the compiler's not ignoring everything after that comment identifier. Programs I write using Microsoft Visual C++ don't complain during the build process when I end a '//' comment with the '\' character, even when I have the compiler set to complain about anything and everything.
First off, a side remark: why use single-line comments for a half-page block comment? I thought that everything after the '//' comment was supposed to be ignored. Well, almost, but not quite everything. The technical details set aside, suffice it to say that processing of backslash-linebreak line continuation is done by the preprocessor before it interprets comment characters. I.e.
//int foo = 42;
The forum software turned this:
// int foo = 42;
Your points are well taken. Without getting into a philosophical debate about coding styles, etc., the bottom line is that I'm just trying to foster continuous improvement of the tools and report what looks like a bug to me.
In the meantime you'll probably find that wrapping the whole block in a #if 0 #endif will get rid of the warning.
View all questions in Keil forum