Hi, I am trying to compile a example code from Atmel, which was written for Atmel Studio IDE, GCC or IAR compilers, and getting the following error:
error: #59: function call is not allowed in a constant expression
This is an similar example of the code:
const sam_abc xy_settings = {function_yz(), 111, 250 };
- sam_abc is a struct - function_yz() is the function which causes the error
I am using µVision V4.54.0.0 (C Compiler: Armcc).
How could I solve this problem? Can someone please help me. Thanks in advance.
Jan
Thanks for the help!
So this looks like to be a compiler specific error (?), because the code compiles without any errors using Atmel Studio.
I thought there could be a solution to use the value of the function in the const expression anyhow. But now I will insert the value directly.