compiling error

nobody wrote on Monday, September 18, 2006:

Hi All,
I just started with FreeRTOS.
please may someone tell me why i receive "error(128):Function argument incomplatible with its declaretion " when compiling this:

int main(void)
{
   /* Create the sample tasks. */
   xTaskCreate( Task1, "Task1",           configMINIMAL_STACK_SIZE, (void *)10,  tskIDLE_PRIORITY + 1, NULL);

    vTaskStartScheduler();

    return 0;
}

void Task1( void *pvParameters )
{
  int x = (int)pvParameters;

     for( ;; )
     {
         // Task code goes here.
     }

}

nobody wrote on Monday, September 18, 2006:

Assuming the error is for the xTaskCreate() call - have you a prototype for the function Task1 before main()?

nobody wrote on Monday, September 18, 2006:

Thank you for you response,
Yes, the prototype is on "task.h", included just above main.
The error refers to the pcName argument.

signed portBASE_TYPE xTaskCreate(
     pdTASK_CODE pvTaskCode,
     const signed portCHAR * const pcName,
     //const portCHAR * const pcName,
     unsigned portSHORT usStackDepth,
     void *pvParameters,
     unsigned portBASE_TYPE uxPriority,
     xTaskHandle *pvCreatedTask
     );

Israel

nobody wrote on Monday, September 18, 2006:

Not sure if we are talking at cross purposes here.  I was referring to a prototype for Task1 function, not the inclusion of task.h.  It seems this is not the problem anyway if the error is on the pcName parameter.

You could try casting it to const * const.

Which compiler for which chip are you using?  Some compilers default char * to signed char *, and some to unsigned char * which is why FreeRTOS has to cast everything explicitly to remove the warnings.

nobody wrote on Monday, September 18, 2006:

I’m trying to port to an old z80 board  wit a IAR compiler, and this is the definition of types on portmacro.h

/* Type definitions. */
#define portCHAR        char
#define portFLOAT        float
#define portDOUBLE        double
#define portLONG        long
#define portSHORT        short
#define portSTACK_TYPE    unsigned int
#define portBASE_TYPE    int

nobody wrote on Monday, September 18, 2006:

I’ll study the compiler manual and see if i can find something related to this.

Thank you

Israel