andysworkshop / stm32plus

The C++ library for the STM32 F0, F100, F103, F107 and F4 microcontrollers
http://www.andybrown.me.uk
Other
745 stars 224 forks source link

compile error on arm-none-eabi-gcc 6.1.1 #177

Closed idreamerhx closed 8 years ago

idreamerhx commented 8 years ago

arm-none-eabi-gcc (Arch Repository) 6.1.1 20160526

scons mode=debug mcu=f1md hse=8000000

scons: Reading SConscript files ... stm32plus build version is 040004 scons: done reading SConscript files. scons: Building targets ... arm-none-eabi-g++ -o examples/adc_analog_watchdog/build/debug-f1md-8000000e/adc_analog_watchdog.o -c -Wextra -pedantic-errors -fno-rtti -std=gnu++0x -fno-threadsafe-statics -Wall -Werror -ffunction-sections -fdata-sections -fno-exceptions -mthumb -gdwarf-2 -pipe -DHSE_VALUE=8000000 -mcpu=cortex-m3 -DSTM32PLUS_F1_MD -O0 -g3 -Ilib/include -Ilib/include/stl -Ilib -Iexamples/adc_analog_watchdog examples/adc_analog_watchdog/adc_analog_watchdog.cpp In file included from lib/include/stl/vector:36:0, from lib/include/config/string.h:20, from examples/adc_analog_watchdog/adc_analog_watchdog.cpp:12: lib/include/stl/stl_bvector.h: In member function 'std::vector<bool, _Alloc>::iterator std::vector<bool, _Alloc>::erase(std::vector<bool, _Alloc>::iterator)': lib/include/stl/stl_bvector.h:809:5: error: this 'if' clause does not guard... [-Werror=misleading-indentation] if (__position + 1 != end()) ^~ lib/include/stl/stl_bvector.h:811:7: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' --_M_finish; ^~ cc1plus: all warnings being treated as errors scons: *\ [examples/adc_analog_watchdog/build/debug-f1md-8000000e/adc_analog_watchdog.o] Error 1 scons: building terminated because of errors.

idreamerhx commented 8 years ago

if (__position + 1 != end()) { copy....}

and also, I add -Wno-shift-negative-value to SConstruct

andysworkshop commented 8 years ago

Thanks for the headsup. When gcc 6 becomes a release at the ARM launchpad site then I'll address compatibility issues.

martin31821 commented 8 years ago

I'm experiencing similar problems when trying to compile using GCC6.1 on archlinux. Problems I ran into and their fix (for now):

ghost commented 8 years ago

I have same issue with gcc6.1.1 on archlinux... Is there any progress on this? I was able to solve first two problems by adding warning options as @martin31821 said, but how should I deal with the final problem 'Invalid conversion from int to stm32plus::Endian'? or should I use previous version of GCC?

martin31821 commented 8 years ago

For the last issue, the only help I found was to remove -Werror and -Wpedantic, but this is no solution to the problem, it just tells the compiler to treat these warnings not as errors.

If you get the library itself to build, there are several other build failures in the examples (more specifically timers and pwm)

andysworkshop commented 8 years ago

The currently supported gcc release is documented here

Scytie commented 7 years ago

According to

"Thanks for the headsup. When gcc 6 becomes a release at the ARM launchpad site then I'll address compatibility issues."

6.2.1 is now released on Launchpad

andysworkshop commented 7 years ago

On launchpad this page has a blank downloads section for me. I did find a better looking page at the ARM website and will download it from there to take a look.