3-Phase-Controller
3-Phase-Controller copied to clipboard
Build unsuccessful on avr-g++ 8.2.0
C++ .bld/main.cpp.o
"avr-g++" -o .bld/main.cpp.o main.cpp -c -std=gnu++11 -fno-exceptions -mmcu=atmega32u4 -I. -Ilufa -IAVR++ -IlibCameron/src -DF_CPU=16000000UL -DARCH=ARCH_AVR8 -DF_USB=16000000UL -DUSE_LUFA_CONFIG_HEADER -UAVR -O2 -pipe -Wall -fshort-enums -funsigned-char -funsigned-bitfields -fno-inline-small-functions -fno-strict-aliasing -fpack-struct -ffunction-sections -MMD -MP -MF .bld/.dep/main.cpp.o.d
In file included from Board.h:11,
from main.cpp:8:
AVR++/AVR++/IOpin.h: In instantiation of 'constexpr volatile u1* const AVR::IOpin<AVR::Ports::B, 0>::DDR':
AVR++/AVR++/IOpin.h:29:30: required from 'static void AVR::IOpin<port, pin>::output() [with port = AVR::Ports::B; unsigned char pin = 0]'
AVR++/AVR++/IOpin.h:137:11: required from 'static void AVR::Output<port, pin, inverted, startOn>::init() [with port = AVR::Ports::B; unsigned char pin = 0; bool inverted = true; bool startOn = false]'
AVR++/AVR++/IOpin.h:92:27: required from 'class AVR::Output<AVR::Ports::B, 0, true>'
Board.h:54:38: required from here
AVR++/AVR++/IOpin.h:18:49: in 'constexpr' expansion of 'AVR::Ports::B::DDR()'
AVR++/AVR++/IOpin.h:18:34: error: value '36' of type 'volatile u1*' {aka 'volatile unsigned char*'} is not a constant expression
constexpr static volatile u1 * DDR = port::DDR();
^~~
AVR++/AVR++/IOpin.h: In instantiation of 'constexpr volatile u1* const AVR::IOpin<AVR::Ports::B, 0>::PORT':
AVR++/AVR++/IOpin.h:71:42: required from 'static bool AVR::IOpin<port, pin>::isDriveHigh() [with port = AVR::Ports::B; unsigned char pin = 0]'
AVR++/AVR++/IOpin.h:116:25: required from 'static bool AVR::Output<port, pin, inverted, startOn>::isOn() [with port = AVR::Ports::B; unsigned char pin = 0; bool inverted = true; bool startOn = false]'
Board.h:62:19: required from here
AVR++/AVR++/IOpin.h:21:51: in 'constexpr' expansion of 'AVR::Ports::B::PORT()'
AVR++/AVR++/IOpin.h:21:34: error: value '37' of type 'volatile u1*' {aka 'volatile unsigned char*'} is not a constant expression
constexpr static volatile u1 * PORT = port::PORT();
^~~~
AVR++/AVR++/IOpin.h: In instantiation of 'constexpr volatile u1* const AVR::IOpin<AVR::Ports::F, 4>::DDR':
AVR++/AVR++/IOpin.h:29:30: required from 'static void AVR::IOpin<port, pin>::output() [with port = AVR::Ports::F; unsigned char pin = 4]'
AVR++/AVR++/IOpin.h:137:11: required from 'static void AVR::Output<port, pin, inverted, startOn>::init() [with port = AVR::Ports::F; unsigned char pin = 4; bool inverted = false; bool startOn = false]'
AVR++/AVR++/IOpin.h:92:27: required from 'class AVR::Output<AVR::Ports::F, 4>'
Debug.h:102:8: required from here
AVR++/AVR++/IOpin.h:18:49: in 'constexpr' expansion of 'AVR::Ports::F::DDR()'
AVR++/AVR++/IOpin.h:18:34: error: value '48' of type 'volatile u1*' {aka 'volatile unsigned char*'} is not a constant expression
constexpr static volatile u1 * DDR = port::DDR();
^~~
AVR++/AVR++/IOpin.h: In instantiation of 'constexpr volatile u1* const AVR::IOpin<AVR::Ports::F, 4>::PORT':
AVR++/AVR++/IOpin.h:51:27: required from 'static void AVR::IOpin<port, pin>::set() [with port = AVR::Ports::F; unsigned char pin = 4]'
AVR++/AVR++/IOpin.h:76:40: required from 'static void AVR::IOpin<port, pin>::set(bool) [with port = AVR::Ports::F; unsigned char pin = 4]'
AVR++/AVR++/IOpin.h:102:28: required from 'static void AVR::Output<port, pin, inverted, startOn>::on() [with port = AVR::Ports::F; unsigned char pin = 4; bool inverted = false; bool startOn = false]'
Debug.h:102:10: required from here
AVR++/AVR++/IOpin.h:21:51: in 'constexpr' expansion of 'AVR::Ports::F::PORT()'
AVR++/AVR++/IOpin.h:21:34: error: value '49' of type 'volatile u1*' {aka 'volatile unsigned char*'} is not a constant expression
constexpr static volatile u1 * PORT = port::PORT();
^~~~
make: *** [.bld/main.cpp.o] Error 1
@k-k-s Thank you for reporting this bug. I am not sure what is causing it exactly. I'm betting that avr-gcc 8 tightened some type conversion checks.
If anyone knows why exactly this happens I'd love to fix this issue.