]> granicus.if.org Git - esp-idf/commitdiff
ipc: fix errors for GCC 8 support
authorAnton Maklakov <anton@espressif.com>
Thu, 24 May 2018 11:09:23 +0000 (19:09 +0800)
committerbot <bot@espressif.com>
Mon, 2 Jul 2018 09:05:00 +0000 (09:05 +0000)
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);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

components/esp32/ipc.c

index aedf4edb3b378a76a1d8dfb2988c21baccee2a16..6319a621d7a1c01fc3216fee5e866da11fac3c72 100644 (file)
@@ -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();