I would like the Arduino IDE to display compiler warnings, and I would rather not have to compile once in the terminal for warnings, and again through Arduino to generate the hex file.
Holding down the shift key while clicking the "Verify" button shows intermediate commands, but none of their output. Is this possible without hacking the Arduino IDE?
Using Arduino IDE 1.6.4 and newer, the warning level can be easily adjusted via File > Preferences > Compiler warnings:.
Using Arduino AVR Boards the compiler flags set via this option are:
-w
-Wall
-Wall -Wextra
This feature has been added to the latest Arduino source code, although is not yet in a released version (see https://github.com/arduino/Arduino/commit/a2235e3cdc3856cbeba7de84e81bfd914b3ebaea).
It's planned to be included in the next major Arduino IDE release (version 1.0) which is currently planned for release at the end of October 2011. The current release candidate has this fix (as of October 25, 2011).
To enable compiler warnings from within the Arduino IDE, open
File
|Preferences
then tickShow verbose output during: compilation
and/orShow verbose output during: upload
.The default compiler command line options include -w, which suppresses warnings, but you can change that by editing
C:\Program Files (x86)\Arduino\hardware\arduino\avr\platform.txt
. Since the libraries might contain warnings, but I want -Werror for myself, I removed the -w options, and then added to my source code:Most answers here seem to be outdated. From Arduino.app 1.5 onwards you must find the file preferences.txt (https://www.arduino.cc/en/Hacking/Preferences) and change the line
compiler.warning_level=none
tocompiler.warning_level=all
IMPORTANT: Quit Arduino first, edit, then start the IDE again.The feature as described @Matthew, not only displays the warnings, but a lot of distracting information on how the compiler was called as well.
See the addendum to my question Have Arduino IDE set compiler warnings to error implement the changes to the arduino script:
and make the
extra/avr-g++
:Comment out
extend = True
if you do not want the compiler to interpret warnings in your source as errors.