arduino-preprocessor
arduino-preprocessor copied to clipboard
#warning is removed
Using Arduino IDE 1.9.0-beta build 25 with Windows 7 64 bit
- File > Preferences > Compiler warnings: > any setting above "None"
- Compile the following sketch:
#warning foo void setup() {} void loop() {} - Examine the output in the console for the expected warning. It is not there.
The line #warning foo is missing from the preprocessed .ino.cpp file in the temporary build folder.
arduino-preprocessor -debug output:
https://gist.githubusercontent.com/per1234/4a355c6872fbca648378aaf3974fffd4/raw/5a775baad27a738b21abbc57a6682fd863b31a75/arduino-preprocessor_debug_output.txt
The issue does not occur with Arduino IDE 1.8.6 Hourly Build 2017/11/13 or Arduino IDE 1.8.5.
Well, what did you expect when you set "Compiler warnings" to "None"?
@PaulStoffregen, he said "any setting above "None"
What I believe happens here, is that the sketch sources are preprocessed before the prototypes are inserted (to prevent inserting the prototypes in a place that is removed by preprocessing). However, this means that when compiling the sketch code, it is already preprocessed. I can see three fixes:
- Tell gcc to only process #include, #if, etc., but leave #warning and #error in the source when preprocessing (I vaguely recall there is an option for this, but I'm not sure). The downside is that this requires modifying recipes.
- Insert the prototypes into the unpreprocessed source, using the preprocessed source only to figure out the correct position (using the line directives to translate back to the unpreprocessed source).
- Show any compiler output from the preprocessing stage. I believe this is output is now redirected to
/dev/null, but it might actually make sense to just show it. It might be slightly confusing that these warnings are then shown a bit further up than actual errors, but that's just a minor issue.
Option #3 is probably the easiest and most portable of these, and even though the output is slightly mixed up, all relevant warnings should at least be shown.
are that #warning and #error preprocessor removed
add tag "help wanted"
error:
"Compiler Warming" = "none"
@LEKPHET-KUNSUE AKA "Phetdanai" I see you have created a new account to circumvent your GitHub ban and are continuing your previous pattern of adding pointless comments in our repositories. I'll give you the same warning as I did last time:
Please stop leaving these pointless comments. These generate noise that waste the time of the contributors who provide the development work that benefits the entire Arduino community so they are very harmful.
If I see any more abusive behavior from you then I am going to block you from accessing any of Arduino's repositories and report your account to GitHub.