]> granicus.if.org Git - esp-idf/commitdiff
gcc8_newlib3: Compilation warnings and errors not specific to newlib v3
authorAlexey Gerenkov <alexey@espressif.com>
Thu, 14 Jun 2018 16:11:21 +0000 (19:11 +0300)
committerAlexey Gerenkov <alexey@espressif.com>
Mon, 9 Jul 2018 10:22:24 +0000 (13:22 +0300)
17 files changed:
components/app_trace/sys_view/esp32/SEGGER_RTT_esp32.c
components/coap/component.mk
components/coap/port/coap_io_socket.c
components/console/argtable3/argtable3.c
components/cxx/cxx_exception_stubs.cpp
components/driver/rtc_module.c
components/driver/sdio_slave.c
components/esp32/clk.c
components/esp32/include/esp_wifi_crypto_types.h
components/expat/component.mk
components/expat/library/xmlparse.c
components/expat/library/xmltok_impl.c
components/freertos/test/test_freertos_debug_functions.c
components/libsodium/component.mk
components/mbedtls/port/mbedtls_debug.c
components/nghttp/port/http_parser.c
components/wpa_supplicant/src/wpa2/tls/x509v3.c

index c8b199540e355a545d31db66cecf732a672d9e43..0cb92be55c23bd78da092f4ca2a877745c0b0195 100644 (file)
@@ -20,7 +20,6 @@
 #include "rom/ets_sys.h"
 #include "esp_app_trace.h"
 
-#define LOG_LOCAL_LEVEL ESP_LOG_ERROR
 #include "esp_log.h"
 const static char *TAG = "segger_rtt";
 
@@ -125,7 +124,7 @@ unsigned SEGGER_RTT_WriteSkipNoLock(unsigned BufferIndex, const void* pBuffer, u
   uint8_t event_id = *pbuf;
 
   if (NumBytes > SYSVIEW_EVENTS_BUF_SZ) {
-      ESP_LOGE(TAG, "Too large event %d bytes!", NumBytes);
+      ESP_LOGE(TAG, "Too large event %u bytes!", NumBytes);
       return 0;
   }
   if (xPortGetCoreID()) { // dual core specific code
index 012188d7aba9eef3225881681ac24c340bb07df3..4b3d56f5676745e66f258be6e490362f08ff4906 100644 (file)
@@ -12,3 +12,5 @@ COMPONENT_SUBMODULES += libcoap
 
 libcoap/src/debug.o: CFLAGS += -Wno-write-strings
 libcoap/src/pdu.o: CFLAGS += -Wno-write-strings
+# Temporary suppress "fallthrough" warnings until they are fixed in libcoap repo
+libcoap/src/option.o: CFLAGS += -Wno-implicit-fallthrough
index eec8cc1319a4e59ab71a7982b85a189797a221f5..4c3f85b458b92929ab79b99a53ac8a0f6bc472d0 100644 (file)
@@ -374,8 +374,8 @@ coap_network_read(coap_endpoint_t *ep, coap_packet_t **packet) {
              }
 
              /* local interface for IPv4 */
-             (*packet)->src.size = sizeof((*packet)->src.addr);
-             memcpy(&(*packet)->src.addr.sa, &soc_srcipaddr, (*packet)->src.size);
+             (*packet)->src.size = sizeof((*packet)->src.addr.sa);
+             memcpy(&((*packet)->src.addr.sa), &soc_srcipaddr, (*packet)->src.size);
 
              if (len > coap_get_max_packetlength(*packet)) {
                 /* FIXME: we might want to send back a response */
index 3fdda9068decec469c518660e6d6c996d2768e82..282869f9c0f97983570b46429df1ef886ef12a4b 100644 (file)
@@ -3071,6 +3071,7 @@ static int trex_charnode(TRex *exp,TRexBool isclass)
                                        exp->_p++;
                                        return node;
                                } //else default
+                               /* falls through */
                        default:
                                t = *exp->_p; exp->_p++;
                                return trex_newnode(exp,t);
index 3f7632c6d5e34c5861cb9defed1b015cb326340c..b67bc2ad34ffb87339b4471e1f0916071deda71c 100644 (file)
@@ -13,12 +13,23 @@ extern "C" void __cxx_fatal_exception(void)
     abort();
 }
 
+extern "C" bool __cxx_fatal_exception_bool(void)
+{
+    __cxx_fatal_exception();
+    return false;
+}
+
 extern "C" void __cxx_fatal_exception_message(const char *msg)
 {
     printf("%s%s\n", FATAL_EXCEPTION, msg);
     abort();
 }
 
+extern "C" void __cxx_fatal_exception_message_va(const char *msg, ...)
+{
+    __cxx_fatal_exception_message(msg);
+}
+
 extern "C" void __cxx_fatal_exception_int(int i)
 {
     printf("%s (%d)\n", FATAL_EXCEPTION, i);
@@ -43,7 +54,7 @@ void std::__throw_length_error(const char*) __attribute__((alias("__cxx_fatal_ex
 
 void std::__throw_out_of_range(const char*) __attribute__((alias("__cxx_fatal_exception_message")));
 
-void std::__throw_out_of_range_fmt(const char*, ...) __attribute__((alias("__cxx_fatal_exception_message")));
+void std::__throw_out_of_range_fmt(const char*, ...) __attribute__((alias("__cxx_fatal_exception_message_va")));
 
 void std::__throw_runtime_error(const char*) __attribute__((alias("__cxx_fatal_exception_message")));
 
@@ -84,6 +95,6 @@ extern "C" void __cxa_rethrow(void) __attribute__((alias("__cxx_fatal_exception"
 extern "C" void __cxa_throw(void) __attribute__((alias("__cxx_fatal_exception")));
 extern "C" void __cxa_call_terminate(void) __attribute__((alias("__cxx_fatal_exception")));
 
-bool std::uncaught_exception() __attribute__((alias("__cxx_fatal_exception")));
+bool std::uncaught_exception() __attribute__((alias("__cxx_fatal_exception_bool")));
 
 #endif // CONFIG_CXX_EXCEPTIONS
index 7c8f5ae69d00b76470f6631212af32ec7c131e72..333f50cc11d9f93537524e1491b96ab0548d4357 100644 (file)
@@ -98,12 +98,12 @@ In ADC2, there're two locks used for different cases:
 adc2_spinlock should be acquired first, then adc2_wifi_lock or rtc_spinlock.
 */
 //prevent ADC2 being used by wifi and other tasks at the same time.
-static _lock_t adc2_wifi_lock = NULL;
+static _lock_t adc2_wifi_lock;
 //prevent ADC2 being used by tasks (regardless of WIFI)
 portMUX_TYPE adc2_spinlock = portMUX_INITIALIZER_UNLOCKED;
 
 //prevent ADC1 being used by I2S dma and other tasks at the same time.
-static _lock_t adc1_i2s_lock = NULL;
+static _lock_t adc1_i2s_lock;
 
 typedef struct {
     TimerHandle_t timer;
index e64802aa57aa4ebf1e035c10ad7bbbfb39be85bb..3892cb6b20b73ac28518b4c6f73fcddcb0d44d23 100644 (file)
@@ -277,7 +277,7 @@ static inline uint8_t* sdio_ringbuf_offset_ptr(sdio_ringbuf_t *buf, sdio_ringbuf
 static esp_err_t sdio_ringbuf_send(sdio_ringbuf_t* buf, esp_err_t (*copy_callback)(uint8_t*, void*), void* arg, TickType_t wait)
 {
     portBASE_TYPE ret = xSemaphoreTake(buf->remain_cnt, wait);
-    if (ret != pdTRUE) return NULL;
+    if (ret != pdTRUE) return ESP_ERR_TIMEOUT;
 
     portENTER_CRITICAL(&buf->write_spinlock);
     uint8_t* get_ptr = sdio_ringbuf_offset_ptr(buf, ringbuf_write_ptr, buf->item_size);
index 41b24c6ed9161a30e584a65431cb73fbddb93ff5..e6874e3f4b88f4501632e688b40f3db300cce609 100644 (file)
@@ -88,7 +88,7 @@ void esp_clk_init(void)
             break;
         default:
             freq_mhz = 80;
-            /* no break */
+            /* falls through */
         case 80:
             freq = RTC_CPU_FREQ_80M;
             break;
index 0848f06ac90d5fa216a141fe9f1379e70cf4ad45..e1e2a51a131a8284dd01d20151deae1a3a958768 100644 (file)
@@ -607,7 +607,7 @@ typedef void (*esp_uuid_gen_mac_addr_t)(const unsigned char *mac_addr, unsigned
  * @brief free the message after finish DH
  * 
  */
-typedef void (*esp_dh5_free_t)(void *ctx);
+typedef void (*esp_dh5_free_t)(void *ctx);
 
 /**
  * @brief Build WPS IE for (Re)Association Request
index 0ee1199d1b056bac6cb0484826defa3aa9b2c408..bf34d31426e767c4f6d2eb92c23af7b5fb901a29 100644 (file)
@@ -6,4 +6,5 @@ COMPONENT_ADD_INCLUDEDIRS := port/include include/expat
 COMPONENT_SRCDIRS := library port
 
 CFLAGS += -Wno-unused-function -DHAVE_EXPAT_CONFIG_H
-
+# Temporary suppress "fallthrough" warnings until they are fixed in expat repo
+CFLAGS += -Wno-implicit-fallthrough
index e69622bcfbe896fb5d703911e200fef53da817ee..0f9c7ae789ce10ee2333218e002c1f0b4d8be115 100644 (file)
@@ -1554,6 +1554,7 @@ XML_Parse(XML_Parser parser, const char *s, int len, int isFinal)
       errorCode = XML_ERROR_NO_MEMORY;
       return XML_STATUS_ERROR;
     }
+    /* falls through */
   default:
     ps_parsing = XML_PARSING;
   }
@@ -1680,6 +1681,7 @@ XML_ParseBuffer(XML_Parser parser, int len, int isFinal)
       errorCode = XML_ERROR_NO_MEMORY;
       return XML_STATUS_ERROR;
     }
+    /* falls through */
   default:
     ps_parsing = XML_PARSING;
   }
@@ -4266,8 +4268,8 @@ doProlog(XML_Parser parser,
           return XML_ERROR_NO_MEMORY;
         declEntity->publicId = NULL;
       }
-      /* fall through */
 #endif /* XML_DTD */
+      /* falls through */
     case XML_ROLE_ENTITY_SYSTEM_ID:
       if (dtd->keepProcessing && declEntity) {
         declEntity->systemId = poolStoreString(&dtd->pool, enc,
index 5f779c0571b5b16f5296adc0fc8336dce16e8b8d..b78512998366bfcb70ad720e21efb5da587def9f 100644 (file)
@@ -47,6 +47,7 @@
       *nextTokPtr = ptr; \
       return XML_TOK_INVALID; \
     } \
+    /* fall through */ \
   case BT_NMSTRT: \
   case BT_HEX: \
   case BT_DIGIT: \
@@ -75,6 +76,7 @@
       *nextTokPtr = ptr; \
       return XML_TOK_INVALID; \
     } \
+    /* fall through */ \
   case BT_NMSTRT: \
   case BT_HEX: \
     ptr += MINBPC(enc); \
@@ -575,7 +577,7 @@ PREFIX(scanAtts)(const ENCODING *enc, const char *ptr, const char *end,
           return XML_TOK_INVALID;
         }
       }
-    /* fall through */
+      /* fall through */
     case BT_EQUALS:
       {
         int open;
@@ -1403,6 +1405,7 @@ PREFIX(isPublicId)(const ENCODING *enc, const char *ptr, const char *end,
     case BT_NMSTRT:
       if (!(BYTE_TO_ASCII(enc, ptr) & ~0x7f))
         break;
+      /* fall through */
     default:
       switch (BYTE_TO_ASCII(enc, ptr)) {
       case 0x24: /* $ */
index 70c1b5b0cd6d0b6f802ad5eb70409bb73ce2e35c..0a6e147359bc419bb3cc1bf5e86ea8648843d5f2 100644 (file)
@@ -16,7 +16,7 @@
 #if (CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE > 0)
 #define NO_OF_QUEUES_PER_CORE  ((int)((CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE - 3)/portNUM_PROCESSORS))     //Save space for some preallocated tasks
 #define NO_OF_QUEUES_TOTAL    (NO_OF_QUEUES_PER_CORE * portNUM_PROCESSORS)
-#define QUEUE_NAME_MAX_LENGTH    10
+#define QUEUE_NAME_MAX_LENGTH    30
 
 static SemaphoreHandle_t start_sem[portNUM_PROCESSORS];
 static SemaphoreHandle_t done_sem = NULL;
index 9862a274b8d654e993c7b39954ff91399b62597e..12dcb571a515c2c4e8109a80ad0de3aea2001991 100644 (file)
@@ -86,3 +86,7 @@ CFLAGS +=  -DNATIVE_LITTLE_ENDIAN -DHAVE_WEAK_SYMBOLS -D__STDC_LIMIT_MACROS -D__
 
 # randombytes.c needs to pull in platform-specific implementation
 $(LSRC)/randombytes/randombytes.o: CFLAGS+=-DRANDOMBYTES_DEFAULT_IMPLEMENTATION
+
+# Temporary suppress "fallthrough" warnings until they are fixed in libsodium repo
+$(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphashx24_ref.o: CFLAGS += -Wno-implicit-fallthrough
+$(LSRC)/crypto_shorthash/siphash24/ref/shorthash_siphash24_ref.o: CFLAGS += -Wno-implicit-fallthrough
index e9f038b6ab6be9143ea5734b0ce7941a739acf99..316a76a990a6fe8ed41fa67fe57163032c6c2861 100644 (file)
@@ -34,12 +34,16 @@ void mbedtls_esp_enable_debug_log(mbedtls_ssl_config *conf, int threshold)
     switch(threshold) {
     case 1:
         level = ESP_LOG_WARN;
+        break;
     case 2:
         level = ESP_LOG_INFO;
+        break;
     case 3:
         level = ESP_LOG_DEBUG;
+        break;
     case 4:
         level = ESP_LOG_VERBOSE;
+        break;
     }
     esp_log_level_set(TAG, level);
 }
@@ -76,6 +80,7 @@ static void mbedtls_esp_debug(void *ctx, int level,
         break;
     case 3:
         ESP_LOGD(TAG, "%s:%d %s", file, line, str);
+        break;
     case 4:
         ESP_LOGV(TAG, "%s:%d %s", file, line, str);
         break;
index 3c896ffadcc0dbf13942457d32c77d15bfec33e7..8c1f4dd077752fce59996953aba8079790210381 100644 (file)
@@ -1814,7 +1814,7 @@ reexecute:
 
             case 2:
               parser->upgrade = 1;
-
+              /* falls through */
             case 1:
               parser->flags |= F_SKIPBODY;
               break;
@@ -2374,7 +2374,7 @@ http_parser_parse_url(const char *buf, size_t buflen, int is_connect,
       case s_req_server_with_at:
         found_at = 1;
 
-      /* FALLTROUGH */
+        /* falls through */
       case s_req_server:
         uf = UF_HOST;
         break;
index f7962db81c70e702acf9ceea4660e7839d5469e4..66a0e448e6366cb1597902cb60c5117dfd00f75a 100644 (file)
@@ -494,20 +494,28 @@ static char * x509_name_attr_str(enum x509_name_attr_type type)
        switch (type) {
         case X509_NAME_ATTR_NOT_USED:
             strcpy(name_attr, "[N/A]");
+            break;
         case X509_NAME_ATTR_DC:
             strcpy(name_attr, "DC");
+            break;
         case X509_NAME_ATTR_CN:
             strcpy(name_attr, "CN");
+            break;
         case X509_NAME_ATTR_C:
             strcpy(name_attr, "C");
+            break;
         case X509_NAME_ATTR_L:
             strcpy(name_attr, "L");
+            break;
         case X509_NAME_ATTR_ST:
             strcpy(name_attr, "ST");
+            break;
         case X509_NAME_ATTR_O:
             strcpy(name_attr, "O");
+            break;
         case X509_NAME_ATTR_OU:
             strcpy(name_attr, "OU");
+            break;
         default :
             strcpy(name_attr, "?");
        }