From 730025cefc817eb6287521fdd18995c999bb7437 Mon Sep 17 00:00:00 2001 From: Markus Sattler Date: Sun, 17 May 2015 00:11:41 +0200 Subject: [PATCH] add some __attribute__ for compiler to get better optimizations and warning handle --- hardware/tools/esp8266/sdk/include/ets_sys.h | 6 +++--- hardware/tools/esp8266/sdk/include/osapi.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hardware/tools/esp8266/sdk/include/ets_sys.h b/hardware/tools/esp8266/sdk/include/ets_sys.h index b7b79c341..7908699bb 100644 --- a/hardware/tools/esp8266/sdk/include/ets_sys.h +++ b/hardware/tools/esp8266/sdk/include/ets_sys.h @@ -91,10 +91,10 @@ typedef void (*int_handler_t)(void*); ETS_INTR_DISABLE(ETS_GPIO_INUM) -void *pvPortMalloc(size_t xWantedSize); -void *pvPortRealloc(void* ptr, size_t xWantedSize); +void *pvPortMalloc(size_t xWantedSize) __attribute__((malloc, alloc_size(1))); +void *pvPortRealloc(void* ptr, size_t xWantedSize) __attribute__((alloc_size(2))); void pvPortFree(void *ptr); -void *vPortMalloc(size_t xWantedSize); +void *vPortMalloc(size_t xWantedSize) __attribute__((malloc, alloc_size(1))); void vPortFree(void *ptr); void *ets_memcpy(void *dest, const void *src, size_t n); void *ets_memset(void *s, int c, size_t n); diff --git a/hardware/tools/esp8266/sdk/include/osapi.h b/hardware/tools/esp8266/sdk/include/osapi.h index 6935388c5..11e03803f 100644 --- a/hardware/tools/esp8266/sdk/include/osapi.h +++ b/hardware/tools/esp8266/sdk/include/osapi.h @@ -50,7 +50,7 @@ os_printf_plus(flash_str, ##__VA_ARGS__); \ } while(0) #else -extern int os_printf_plus(const char * format, ...); +extern int os_printf_plus(const char * format, ...) __attribute__ ((format (printf, 1, 2))); #define os_printf os_printf_plus #endif