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
Locked Topic Compile error from different compiler flags (Read 3441 times)
h4nd
Newbies
*
Offline


Posts: 4
Joined: Aug 5th, 2015
Compile error from different compiler flags
Aug 5th, 2015 at 9:19pm
 
Hi
My project compiles in the Arduino 1.6.3 environment. When I compile in Visualmicro on VSCE2013, I get the error "warning: iteration 4u invokes undefined behavior [-Waggressive-loop-optimizations]"

I notice that the compile flags are different:
Arduino IDE compile
C:\Program Files\Arduino\hardware\tools\avr/bin/avr-g++
-c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10603 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -IC:\Program Files\Arduino\hardware\arduino\avr\cores\arduino -IC:\Program Files\Arduino\hardware\arduino\avr\variants\mega

VisualMicro compile
"C:\Program Files\Arduino\hardware\tools\avr/bin/avr-g++"
-c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=163 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR -I"C:\Program Files\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files\Arduino\hardware\arduino\avr\variants\mega" 1\mega_atmega2560\SimpleModbusSlaveExample1.cpp" -o 1\mega_atmega2560\SimpleModbusSlaveExample1.cpp.o"

The differences seem to be:
"-w" vs "-Wall", and 
"-DARDUINO=10603" vs "-DARDUINO=163"

How do I alter the VisualMicro flags to get the same compile result?

Thanks in advance
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12188
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error from different compiler flags
Reply #1 - Aug 5th, 2015 at 10:05pm
 
Please make sure you have not switched on "tools>visual micro>compiler warnings" ?

Arduino is hiding warnings

By the way you say you are getting an error but showing a warning. The compile should be OK and the same as the Arduino other than the warning report?

Thanks
« Last Edit: Aug 5th, 2015 at 10:13pm by Tim@Visual Micro »  
Back to top
IP Logged
 
h4nd
Newbies
*
Offline


Posts: 4
Joined: Aug 5th, 2015
Re: Compile error from different compiler flags
Reply #2 - Aug 5th, 2015 at 11:10pm
 
Thanks, I had switched warnings on (a preferred working habit). I had assumed another problem I was seeing was due to this warning.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint