fl
2017-04-23 18:17:17 UTC
Hi,
After I copy a code snippet to a test .c project, I have such an error when
I carelessly add a 'static' key word at the beginning.
"28 expression must have a constant value"
static const UART_HWAttrs uartHWAttrs[EK_UARTCOUNT] = {
{
.baseAddr = UART0_BASE,
.intNum = INT_UART0,
.intPriority = (~0),
.flowControl = UART_FLOWCONTROL_NONE,
.ringBufPtr = uartTivaRB[0],
.ringBufSize = sizeof(uartTivaRB[0])
}
};
.............
Can you tell me why 'static' can cause such an error?
What rule does it violate?
Thanks,
After I copy a code snippet to a test .c project, I have such an error when
I carelessly add a 'static' key word at the beginning.
"28 expression must have a constant value"
static const UART_HWAttrs uartHWAttrs[EK_UARTCOUNT] = {
{
.baseAddr = UART0_BASE,
.intNum = INT_UART0,
.intPriority = (~0),
.flowControl = UART_FLOWCONTROL_NONE,
.ringBufPtr = uartTivaRB[0],
.ringBufSize = sizeof(uartTivaRB[0])
}
};
.............
Can you tell me why 'static' can cause such an error?
What rule does it violate?
Thanks,