Page 1 of 1

ошибка компиляции

Posted: Sat Dec 27, 2014 3:06 pm
by puff
ок, сделаем новую тему
пробую собрать

Code: Select all

make
Compiler Options
arm-none-eabi-g++ -c -mcpu=cortex-m4 -std=c++11 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Werror=write-strings -Werror=type-limits -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wall -Wextra -Wa,-alms=build/lst/ -DST_STM32F4_DISCOVERY -DCORTEX_USE_FPU=TRUE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/build.d -I. -Ichibios/os/ports/common/ARMCMx/CMSIS/include -Ichibios/os/ports/common/ARMCMx -Ichibios/os/ports/GCC/ARMCMx -Ichibios/os/ports/GCC/ARMCMx/STM32F4xx -Ichibios/os/kernel/include -Ichibios/os/hal/include -Ichibios/os/hal/platforms/STM32F4xx -Ichibios/os/hal/platforms/STM32 -Ichibios/os/hal/platforms/STM32/GPIOv2 -Ichibios/os/hal/platforms/STM32/I2Cv1 -Ichibios/os/hal/platforms/STM32/OTGv1 -Ichibios/os/hal/platforms/STM32/RTCv2 -Ichibios/os/hal/platforms/STM32/SPIv1 -Ichibios/os/hal/platforms/STM32/TIMv1 -Ichibios/os/hal/platforms/STM32/USARTv1 -Ichibios/boards/ST_STM32F4_DISCOVERY -Ichibios/os/various/cpp_wrappers -Ichibios/os/various -Iconfig/stm32f4ems -Iconfig/engines -Iconfig -Ichibios/os/various -Iext -Iext_algo -Iutil -Iconsole_util -Iconsole -Iconsole/tunerstudio -Ihw_layer -Ihw_layer/serial_over_usb -Ihw_layer/algo -Ihw_layer/lcd -Ihw_layer/stm32f4 -Iemulation -Iemulation/hw_layer -Iemulation/test -Icontrollers -Icontrollers/sensors -Icontrollers/system -Icontrollers/algo -Icontrollers/core -Icontrollers/math -Icontrollers/trigger main.cpp -o main.o -llibstd++

и получаю ошибку:

Code: Select all

Compiling rfiutil.c
./console_util/rfiutil.c: In function 'printHistogram':
./console_util/rfiutil.c:100:30: warning: unused parameter 'logging' [-Wunused-parameter]
./console_util/rfiutil.c:100:52: warning: unused parameter 'histogram' [-Wunused-parameter]
…
…
Compiling io_pins.c
./hw_layer/io_pins.c: In function 'getHwPort':
./hw_layer/io_pins.c:77:2: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
./hw_layer/io_pins.c: In function 'getHwPin':
./hw_layer/io_pins.c:87:2: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
cc1: all warnings being treated as errors
make: *** [build/obj/io_pins.o] Error 1
раньше, пусть и с предупреждениями, но собиралось (и вроде бы даже мигало светодиодами и подключалось консолью)

что мне предпринять, чтобы оно снова стало собираться?

Re: ошибка компиляции

Posted: Sat Dec 27, 2014 3:11 pm
by AndreyB
А откуда это "-Werror=type-limits" вообще вылезает? В моих файлах этого не было.

Я сейчас добавил -Werror=type-limits и у меня оно работает - видимо, разные версии компилятора?

Тебе должно помочь сделать -Wno-error=type-limits

Re: ошибка компиляции

Posted: Sat Dec 27, 2014 3:22 pm
by puff
спасибо, поменял makefile в первых строчках, с вот такими опциями собралось вроде бы:

Code: Select all

ompiler Options
arm-none-eabi-g++ -c -mcpu=cortex-m4 -std=c++11 -fno-rtti -fno-exceptions -fno-use-cxa-atexit -Werror=write-strings -Werror=type-limits -mfloat-abi=hard -mfpu=fpv4-sp-d16 -fsingle-precision-constant -Wall -Wextra -Wa,-alms=build/lst/ -DST_STM32F4_DISCOVERY -DCORTEX_USE_FPU=TRUE -DTHUMB_PRESENT -mno-thumb-interwork -DTHUMB_NO_INTERWORKING -MD -MP -MF .dep/build.d -I. -Ichibios/os/ports/common/ARMCMx/CMSIS/include -Ichibios/os/ports/common/ARMCMx -Ichibios/os/ports/GCC/ARMCMx -Ichibios/os/ports/GCC/ARMCMx/STM32F4xx -Ichibios/os/kernel/include -Ichibios/os/hal/include -Ichibios/os/hal/platforms/STM32F4xx -Ichibios/os/hal/platforms/STM32 -Ichibios/os/hal/platforms/STM32/GPIOv2 -Ichibios/os/hal/platforms/STM32/I2Cv1 -Ichibios/os/hal/platforms/STM32/OTGv1 -Ichibios/os/hal/platforms/STM32/RTCv2 -Ichibios/os/hal/platforms/STM32/SPIv1 -Ichibios/os/hal/platforms/STM32/TIMv1 -Ichibios/os/hal/platforms/STM32/USARTv1 -Ichibios/boards/ST_STM32F4_DISCOVERY -Ichibios/os/various/cpp_wrappers -Ichibios/os/various -Iconfig/stm32f4ems -Iconfig/engines -Iconfig -Ichibios/os/various -Iext -Iext_algo -Iutil -Iconsole_util -Iconsole -Iconsole/tunerstudio -Ihw_layer -Ihw_layer/serial_over_usb -Ihw_layer/algo -Ihw_layer/lcd -Ihw_layer/stm32f4 -Iemulation -Iemulation/hw_layer -Iemulation/test -Icontrollers -Icontrollers/sensors -Icontrollers/system -Icontrollers/algo -Icontrollers/core -Icontrollers/math -Icontrollers/trigger main.cpp -o main.o -llibstd++
чорт. не вижу что изменилось в опциях, но собралось.