7.4 Editor Red Bangs

The Editor highlights syntax and semantic errors, such as missing semicolons and unresolved identifiers, in your source code. Errors are shown in red underline and a red bang “glyph”

is displayed in the left margin of the editor window next to each line that contains an error. An error message is displayed when you mouse over the glyph.

Note: Not all errors in the Editor are actual errors, but may be unrecognized symbols. Try building your code to determine if it will build anyway. For more details, see the section “Errors Caused by Unrecognized Symbols.”

Error Conditions and Additional Marking

Errors may occur when you do one of the following:

  • Type in new code
  • Edit existing code
  • Add an existing file to your project
  • Move a file to a different location in your project
  • Change the properties of the project or one of its source files

If there are any errors in a file, red marks are displayed in the error stripe on the right side of the editor window. The error stripe represents the whole file, not just the lines currently displayed. Double click a mark in the error stripe to jump to the line the mark represents.

Errors Caused by Unrecognized Symbols

A symbol that is unrecognized by a compiler preparser or parser could be marked as an error but may not actually be an error (the code will build). Therefore, if you suspect this type of error, try to build the project anyway.

For examples, see the following issued under 12.5 Errors:

  • For 8-bit code, #asm and #endasm cause red bangs in the Editor window.
  • For 16-bit code, MPLAB XC16 packed attribute statement causes red bangs in the Editor window.
  • For DSC code, MPLAB XC-DSC packed attribute statement causes red bangs in the Editor window.