Menu

#2766 Function Prototype

closed-fixed
None
Front-end
5
2022-04-15
2018-07-02
Kawai
No

I tried to compile FreeRTOS Demo Program, but SDCC reports an error message at xTaskCreate()funcition-call in the flush.c.
So, I made test program to look into the cause of the error and found an curious behavior.

Though I checked it on SDCC 3.5.0 and SDCC3.7.1 , both compiler says same error msg.

//***Source-A
const char * const pMsg = "Hello World!\n";
void ss(const char* const * pDisp);
void main(void)
{
 ss((const char * const *)&pMsg);
}
void ss(const char* const * pDisp)
{
}

$ sdcc test.c
test.c:7: error 78: incompatible types // <=== Error occured !!! (What on earth is the matter?)
from type 'const-char generic const code fixed'
to type 'const-char generic const unknown fixed'
test.c:12: warning 85: in function ss unreferenced function argument : 'pDisp'

On the other hand.....

//***Source-B
const char * const pMsg = "Hello World!\n";
void ss(const char* const * pDisp)
{
}
void main(void)
{
  ss((const char * const *)&pMsg);
}

$ sdcc test.c
test.c:5: warning 85: in function ss unreferenced function argument : 'pDisp'
(There are no error messages)

Related

Wiki: SDCC 4.3.0 Release
Wiki: SDCC-STD-UX

Discussion

  • Philipp Klaus Krause

    • status: open --> closed-fixed
    • assigned_to: Philipp Klaus Krause
    • Category: other --> Front-end
     
  • Philipp Klaus Krause

    Looks like I just fixed this one today in [r13388] while fixing bug [#2629].

     

    Related

    Bugs: #2629
    Commit: [r13388]


    Last edit: Maarten Brock 2022-04-16

Log in to post a comment.