configMAX_TASK_NAME_LEN = 1: bug or feature?

Hi, This macro lets you set the len of the task’s name, but if you don’t want to use task names in your project (due to limited resources mainly), then you might set it to 1 (in order to include a least the null string terminator). However this approach is not true at all, ’cause if you check the Idle task it already has the name “Idle” and it is fixed!! (five chars). Under this escenario your TCBs are going to crash sooner or later because they aren’t allowing space for more than a one character, so critical data in the TCB will be overwritten. There are two obvious workarounds: 1.- configMAX_TASK_NAME_LEN >5 or
2.- Hack the Idle task creation in order to change “Idle” to “” None of them convince me so my question is: is it a bug or feature? Thank you!!

configMAX_TASK_NAME_LEN = 1: bug or feature?

Sorry – but everything in your post is inaccurate. Look at the copy that copies the task name into the TCP;
    #if configMAX_TASK_NAME_LEN > 1
    {
        /* Don't bring strncpy into the build unnecessarily. */
        strncpy( ( char * ) pxTCB->pcTaskName, ( const char * ) pcName, ( unsigned short ) configMAX_TASK_NAME_LEN );
    }
    #endif
    pxTCB->pcTaskName[ ( unsigned short ) configMAX_TASK_NAME_LEN - ( unsigned short ) 1 ] = ( signed char ) '';
configMAX_TASK_NAME_LEN must be at least 1 to fit the NULL, like you say. If it is greater than 1 then only the first configMAX_TASK_NAME_LEN characters are copied in. There is, of course, no buffer overflow, no matter how long the task name is.

configMAX_TASK_NAME_LEN = 1: bug or feature?

“code that copies”, not copy that copies. Hopefully the pasted code will display better in this post.
#if configMAX_TASK_NAME_LEN > 1
{
  /* Don't bring strncpy into the build unnecessarily. */
  strncpy( pxTCB->pcTaskName, pcName, configMAX_TASK_NAME_LEN );
}
#endif
pxTCB->pcTaskName[ configMAX_TASK_NAME_LEN -  1 ] =  '';

configMAX_TASK_NAME_LEN = 1: bug or feature?

Edward, you’re totally right, and I was totally wrong. Cscope shows 10 entries for configMAX_TASK_NAME_LEN, so I didn’t know where to start, but now was easier once you pointed it out. Thank you!!