Manage messages¶
Messages during compilation includes error messages , warning messages , and general messages like makefiles integrity, updated boards configuration files, new releases available for download, and project update.
On the embedXcode+ edition, most of the errors and warnings are already reported when entering the code.
- Please refer to Enable code live check to turn it on and to Use code live check on how to use it.
Manage error messages¶
In case of a failed compilation, the Issue navigator display messages, either warning messages or error messages.
Error
LED
was not declared in this scope.
An error message is highlighted in red and stops the compilation. It points at the line that originated the error.
Here, the board isn’t connected and thus the serial port is not available.

The warning messages are explained in the next section.
Here, LED
was not declared in this scope.

The Report Navigator on the right side provides more details.

The Issue navigator provides a list of all the errors found during compilation.
To display the list of error messages and the corresponding lines of code,
- Click on the icon of the middle to display the Issue navigator:

- Click once on the message highlighted in red to display the line where the error is located.

The cursor points at LED
line 89: the correct variable name is myLED
. The error is just a misspelling. Note that the whole line is in black.

- Change
LED
formyLED
. The line is coloured back.

This feature doesn’t work on the LaunchPad C2000 and on the BeagleBone.
If the click-to-error feature doesn’t work,
-
Ensure the project has been prepared during a first compilation, as per Prepare the project .
-
Check code-sense indexing has been completed, as per Launch the procedure .
-
Ensure the build system is set to legacy, as per Set Xcode Build System to Legacy .
Manage warning messages¶
A warning message is highlighted in yellow and doesn’t stop the compilation, but points at possible cause of errors.
Warning
unusedVariable
is an unused variable.
To display the list of warning messages and the corresponding lines of code,
-
Select a target among All, Build, Make, Fast and click on Run.
-
Click on the icon of the middle to display the Issue navigator:

- Click once on the message highlighted in yellow to display the line where the warning was generated.

Select scope for warning messages¶
This section requires the embedXcode+ edition.
The variable WARNING_OPTIONS
on the main Makefile
selects the scope of the warning messages.
By default, the variable WARNING_OPTIONS
is set to 0: no warning messages are reported.
# Warning options
# ----------------------------------
# Contrary to errors, warnings don't stop compilation but they point at possible cause of errors.
# !!! Help: https://bit.ly/38hi0NC
# For example, unused variables with unused-variable.
#
# If 0, no warnings
# If empty, all warnings, same as WARNING_OPTIONS = all
# WARNING_OPTIONS = all no-missing-braces no-conversion-null no-pointer-arith
# WARNING_OPTIONS = unused-variable unused-function unused-label unused-value no-conversion-null no-pointer-arith
#
WARNING_OPTIONS = 0
If WARNING_OPTIONS
is left empty, all warnings are displayed.
# Warning options
#
WARNING_OPTIONS =
This is the same as WARNING_OPTIONS = all
.
# Warning options
#
WARNING_OPTIONS = all
The all
option corresponds to the -Wall
parameter and usually generates a very long list of warning messages, making the analysis difficult if not impossible. Moreover, only the 200 first messages are displayed.
The solution consists on selecting a scope and targeting specific warnings.
Define the selected warnings by listing the options after the variable `WARNING_OPTIONS
.
Here are two example I use the most.
- To check all the unused elements and save precious SRAM and Flash memory, define the following warning options.
# Warning options
#
WARNING_OPTIONS = unused-variable unused-function unused-label unused-value
The variable unusedVariable
is defined but not used.

Defining but not using a variable is perfectly allowed, but uses SRAM memory.
- To check all the use of
NULL
, define the following warning options.
# Warning options
#
WARNING_OPTIONS = conversion-null pointer-arith
The myLED
variable corresponds to a pin number. Setting it to NULL
is a correct operation but may rise an error somewhere else.

There are many other options for selecting warning messages. For more information,
- Please refer to the Using the GNU Compiler Collection Manual .
Define warning statements¶
This section requires the embedXcode+ edition.
It is also possible to define a warning statement that will raise a warning message during compilation.
- Type in the following line on the code with a
#warning
statement followed by the message to display.

To display the list of warning messages and the corresponding lines of code,
-
Select a target and click on Run.
-
Click on the icon of the middle to display the Issue navigator.

Click once on the message highlighted in yellow to display the line where the warning is located.

Manage general messages¶
Authorise notifications¶
macOS may prompt a dialogue box to authorise the notifications.

- Click on Run to proceed.
Check makefiles integrity¶
The integrity of the makefiles is also checked.
If a makefile has been modified or corrupted, a warning message is displayed. This is a non-blocking warning message.
In the example below, About.mk
differs from the distributed version.

The names of the modified makefiles are listed on the Report Navigator.
==== Check project embed1 ====
WARNING non-valid makefile: About.mk
==== Project embed1 checked ====
- Reinstall the template for greater security.
Update the board configuration file¶
This section requires the embedXcode+ edition.
Each board is defined by a board configuration file. The embedXcode+ edition checks if the template provides newer version of the selected board configuration file for the current project.
If a newer version of the board configuration file is available, a dialogue box prompts for updating it.

-
To update, click on Yes.
-
To cancel, click on No.
A new variable KEEP_BOARDS_CONFIGURATIONS
on the main Makefile
allows to set whether the current board configuration file is going to be kept unchecked and unchanged.
By default, it is set to false
to allow the check.
# For boards, keep configurations unchanged, false or true
KEEP_BOARDS_CONFIGURATIONS = false
To prevent to board configuration file of the project from being checked and changed,
-
Edit the main
Makefile
. -
In case the variable
KEEP_BOARDS_CONFIGURATIONS
doesn’t exit, add it. -
Set
KEEP_BOARDS_CONFIGURATIONS
totrue
.
# For boards, keep configurations unchanged, false or true
KEEP_BOARDS_CONFIGURATIONS = true