Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How to enable highest warning level for compiler (Read 1371 times)
Cong Quyen Knight
Junior Member
**
Offline


Posts: 22
Joined: Nov 29th, 2021
How to enable highest warning level for compiler
Dec 31st, 2021 at 11:38am
Print Post  
Hi Tim,

As title, I wonder how to enable highest warning lever for compiler.
I got an issue that hardly to determine root cause. Return void for non-void function cause unexpected behavior. After I found root cause, I realize compiler not show any warning for this type of error.
I try to look at setting, but no such config for that setting. Does VM support that, or Arduino not support from the beginning?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: How to enable highest warning level for compiler
Reply #1 - Jan 1st, 2022 at 2:59am
Print Post  
Did you see the Warnings setting on the vMicro>Compiler menu. Do you want to increase above that?
  
Back to top
IP Logged
 
Cong Quyen Knight
Junior Member
**
Offline


Posts: 22
Joined: Nov 29th, 2021
Re: How to enable highest warning level for compiler
Reply #2 - Jan 3rd, 2022 at 3:30am
Print Post  
Hi Tim,

I've already saw those Compiler Warning setting (For Project, for Library, for Core)
But after enable them, compiler only warning as -Wall. And not warning about mentioned case.
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2695
Joined: Feb 13th, 2019
Re: How to enable highest warning level for compiler
Reply #3 - Jan 4th, 2022 at 5:08pm
Print Post  
If you go to vMicro > Project Properties > Configuration Extra Flags Project, and add the below value:
Code
Select All
-Werror=return-type
 


Then click out of the value box and rebuild the project it should now throw an error on build as desired.




This is also worth reporting to the author of the core you are using, as some cores already include this by default (e.g. ESP8266) in the below properties (these can be seen for your project by enabling vMicro > Compiler > Show Build Properties):
Code
Select All
compiler.warning_flags=-w -Werror=return-type
compiler.warning_flags.none=-w -Werror=return-type
compiler.warning_flags.default=-Werror=return-type
compiler.warning_flags.more=-Wall -Werror=return-type
compiler.warning_flags.all=-Wall -Wextra -Werror=return-type 

  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint