From: Warren G. <ve...@gm...> - 2017-07-14 01:40:43
|
When I build the current github release of libopencm3, I obtain the following build error: ... CC usart_common_v2.c CC i2c_common_v2.c ../common/i2c_common_v2.c: In function 'i2c_transfer7': ../common/i2c_common_v2.c:431:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (size_t i = 0; i < rn; i++) { ^ ../common/i2c_common_v2.c:431:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code gmake[2]: *** [../../Makefile.include:45: i2c_common_v2.o] Error 1 *Or more verbosely:* *arm-none-eabi-gcc* -Os -Wall -Wextra -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes -Wundef -Wshadow -I../../../include -fno-common -mcpu=cortex-m0 -mthumb -Wstrict-prototypes -ffunction-sections -fdata-sections -MD -DSTM32F0 -ggdb3 -o i2c_common_v2.o -c ../common/i2c_common_v2.c ../common/i2c_common_v2.c: In function 'i2c_transfer7': ../common/i2c_common_v2.c:431:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (size_t i = 0; i < rn; i++) { ^ ../common/i2c_common_v2.c:431:3: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code gmake[1]: *** [../../Makefile.include:45: i2c_common_v2.o] Error 1 I am using the following compiler: $ arm-none-eabi-gcc --version arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 224288] I am able to fix this locally but it would be convenient if this was done in the repo. Thanks, Warren |