From forum [fbea223c] the following code:
const char* const pcTaskStartMsg = "LED flash task started.\r\n";
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
static void vLEDFlashTask( void *pvParameters )
{
/* Queue a message for printing to say the task has started. */
vPrintDisplayMessage( &pcTaskStartMsg ); // <--- FAILED HERE
}
gives:
test.c:8: error 78: incompatible types
from type 'const-unsigned-char generic* const code* code'
to type 'const-unsigned-char generic* const unknown* fixed'
test.c:8: warning 85: in function vLEDFlashTask unreferenced function argument : 'pvParameters'
Bugs: #2766
Discussion: Building FreeRTOS with SDCC
Discussion: fbea223c
Discussion: Cygnal freeRTOS (v9.0.0) Demo build failed with sdcc 3.5.0
Patches: #392
Wiki: SDCC-STD-UX
Bug [#2556] seems similar.
Philipp
Related
Bugs:
#2556Last edit: Maarten Brock 2017-07-15
It seems the problem still exists with SDCC 11119...
Compiling the next code:
causes error:
The same code without testptrs function prototype can be compiled without errors:
Command line:
sdcc -c -mstm8 --opt-code-speed --max-allocs-per-node 100000 --std-c11 testptr.c
Btw as I remember I could compile the same code with some previous SDCC version (probably it was a version prior to 10803)...
Apparently, this fails to compile, even when the address space issue is not there:
Last edit: Philipp Klaus Krause 2022-04-15
Sorry, I was wrong here, put the __code int he wrong place. The following compiles:
So the error message is about the implicit named address space.
Looking into this a bit deeper, I think the underlying issue is an UPOINTER surviving past the parsing stage. That indicates that somewhere, a call to pointerTypes is missing that should have turned it into a GPOINTER here.
In [r13387], I added an assertion to catch this. The bug isn't fixed yet, but the error message is better now.
P.S.: No, pointerTypes gets called on the parameter type. But it apparently has a bug when there are multiple UPOINTER chained, so only one gets fixed.
Related
Commit: [r13387]
Last edit: Philipp Klaus Krause 2022-04-15
Fixed in [r13388]
Related
Commit: [r13388]