Why don the line numbers in an error message match the actual line with the problem?
In many cases an error or warning is reported for a line that follows the line that contains the error. For example, consider these lines; the first is missing a semi-colon at the end: input = read() input += offset; There will an expression error produced, but the error will indicate the second line. This is reasonable as the C language allows statements to be spread over multiple lines, so there is nothing actually wrong with the first line of code. Once the second line is parsed, it then becomes obvious that something is wrong. The error will be flagged at the line at which things first go wrong. If you are seeing error messages that are out by a number of lines, one thing you can check is that your source files are using the correct “new line” characters. If you are compiling under Windows, there should be CR-LF sequence at the end of each line. If, for example the LF character was stripped somehow from a line, IDEs, like MPLAB, would still interpret the remaining CR as a new line