Fraunhofer-IMS/AIfES_for_Arduino

Fix bug in aifes_config.h

dnadalini opened this issue · 2 comments

Hello,

While trying to compile AIfES on an STM32 Nucleo-64 board (STM32L476RG), I got the following error, after including the library in my project:

Description	Resource	Path	Location	Type
expected identifier or '(' before '=' token	ailoss_crossentropy_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/ailoss	line 28	C/C++ Problem
expected identifier or '(' before '=' token	ailoss_crossentropy_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/ailoss	line 52	C/C++ Problem
expected identifier or '(' before '=' token	aimath_f32_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 29	C/C++ Problem
expected identifier or '(' before '=' token	aimath_f32_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 30	C/C++ Problem
expected identifier or '(' before '=' token	aimath_q31_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 28	C/C++ Problem
expected identifier or '(' before '=' token	aimath_q31_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 29	C/C++ Problem
expected identifier or '(' before '=' token	aimath_q31_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 443	C/C++ Problem
expected identifier or '(' before '=' token	aimath_q7_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 28	C/C++ Problem
expected identifier or '(' before '=' token	aimath_q7_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 29	C/C++ Problem
expected identifier or '(' before '=' token	aimath_q7_default.c	/AIfES_TestBug/AIfES_for_Arduino/src/basic/default/aimath	line 30	C/C++ Problem
make: *** [AIfES_for_Arduino/src/basic/default/ailoss/subdir.mk:22: AIfES_for_Arduino/src/basic/default/ailoss/ailoss_crossentropy_default.o] Error 1	AIfES_TestBug		 	C/C++ Problem
make: *** [AIfES_for_Arduino/src/basic/default/aimath/subdir.mk:25: AIfES_for_Arduino/src/basic/default/aimath/aimath_f32_default.o] Error 1	AIfES_TestBug		 	C/C++ Problem
make: *** [AIfES_for_Arduino/src/basic/default/aimath/subdir.mk:25: AIfES_for_Arduino/src/basic/default/aimath/aimath_q31_default.o] Error 1	AIfES_TestBug		 	C/C++ Problem
make: *** [AIfES_for_Arduino/src/basic/default/aimath/subdir.mk:25: AIfES_for_Arduino/src/basic/default/aimath/aimath_q7_default.o] Error 1	AIfES_TestBug		 	C/C++ Problem
make: *** Waiting for unfinished jobs....	AIfES_TestBug		 	C/C++ Problem

Going back to the sources, I found that this is caused by an incomplete macro inside:

AIfES_for_Arduino/src/aifes_config.h
line 96:  #define AISTRING_STORAGE_WRAPPER(S) 

Replacing line 96 with:

#define AISTRING_STORAGE_WRAPPER(S)     const char S[]

seems to fix the problem (which occurs at line 29, 30 of "src/basic/default/aimath/aimath_f32_default.c").

Hi @dnadalini,

thanks for reporting the issue. We will fix the bug with the next release of AIfES.
Until then your fix is fine. However, the desired behavior would be that the string S is not created in that case to save memory.

Best regards
Justus

Bug was fixed with the lattest update to AIfES 2.2.0