Community
Participate
Working Groups
CDT offers a useful feature to comment lines that are selected. In C code, it is possible to split a line of code in more using "\" as shown below: sprintf(strbuf, "\r\nReceive error at COM1: expected value = %02Xh, \ read value = %02Xh ", i, dummy); If I select these two lines, make right-clic and select "Comment" in the context menu, these lines will be commented as shown below: //sprintf(strbuf, "\r\nReceive error at COM1: expected value = %02Xh, \ // read value = %02Xh ", i, dummy); When compiling with GCC, it will report a warning message: "multi-line comment". In this case of lines of code which are split, it is only necessary to comment the first line (as shown below) instead of every split-part of the line: //sprintf(strbuf, "\r\nReceive error at COM1: expected value = %02Xh, \ read value = %02Xh ", i, dummy); With this syntax, GCC doesn't produce any warning.