From: Anton Maklakov Date: Thu, 24 May 2018 11:09:23 +0000 (+0800) Subject: ipc: fix errors for GCC 8 support X-Git-Tag: v3.2-beta1~474^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2a810a318fd1cf2e5768dfe4baf8dbe368be3fd7;p=esp-idf ipc: fix errors for GCC 8 support components/esp32/ipc.c: In function 'esp_ipc_init': components/esp32/ipc.c:82:31: error: '%d' directive writing between 1 and 11 bytes into a region of size 5 [-Werror=format-overflow=] sprintf(task_name,"ipc%d",i); ^~ components/esp32/ipc.c:82:27: note: directive argument in the range [-2147483648, 1] sprintf(task_name,"ipc%d",i); ^~~~~~~ components/esp32/ipc.c:82:9: note: 'sprintf' output between 5 and 15 bytes into a destination of size 8 sprintf(task_name,"ipc%d",i); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ --- diff --git a/components/esp32/ipc.c b/components/esp32/ipc.c index aedf4edb3b..6319a621d7 100644 --- a/components/esp32/ipc.c +++ b/components/esp32/ipc.c @@ -77,7 +77,7 @@ void esp_ipc_init() { s_ipc_mutex = xSemaphoreCreateMutex(); s_ipc_ack = xSemaphoreCreateBinary(); - char task_name[8]; + char task_name[15]; for (int i = 0; i < portNUM_PROCESSORS; ++i) { sprintf(task_name,"ipc%d",i); s_ipc_sem[i] = xSemaphoreCreateBinary();