[FL-2520] FW build with -Wextra (#1185)
* Fixing compiler warnings with -Wextra * More warnings suppression, WIP * Even more warning fixes * Added new lines at end of text files. * Padding fix * Additional fixes to warnings on different build configurations; added -Wextra to default build pipeline * Fixes for Secplus v1 * -additional warnings * +-Wredundant-decls fixes * FuriHal: print stack overflow task name in console * FuriHal: add missing include Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -71,4 +71,4 @@ FURI_NORETURN void furi_halt(const char* message) {
|
||||
furi_hal_console_puts("\r\nSystem halted. Bye-bye!\r\n");
|
||||
furi_hal_console_puts("\033[0m\r\n");
|
||||
__furi_halt();
|
||||
}
|
||||
}
|
||||
|
@@ -14,7 +14,10 @@ extern "C" {
|
||||
#ifdef FURI_DEBUG
|
||||
#define furi_assert(__e) ((__e) ? (void)0 : furi_crash("furi_assert failed\r\n"))
|
||||
#else
|
||||
#define furi_assert(__e) ((void)0)
|
||||
#define furi_assert(__e) \
|
||||
do { \
|
||||
((void)(__e)); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
||||
/** Crash system */
|
||||
|
@@ -40,11 +40,6 @@ extern "C" {
|
||||
#define CLAMP(x, upper, lower) (MIN(upper, MAX(x, lower)))
|
||||
#endif
|
||||
|
||||
// need some common semantics for those two
|
||||
#ifndef SIZEOF_ARRAY
|
||||
#define SIZEOF_ARRAY(arr) (sizeof(arr) / sizeof(arr[0]))
|
||||
#endif
|
||||
|
||||
#ifndef COUNT_OF
|
||||
#define COUNT_OF(x) (sizeof(x) / sizeof(x[0]))
|
||||
#endif
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#include "memmgr.h"
|
||||
#include "common_defines.h"
|
||||
#include <string.h>
|
||||
|
||||
extern void* pvPortMalloc(size_t xSize);
|
||||
@@ -60,17 +61,21 @@ size_t memmgr_get_minimum_free_heap(void) {
|
||||
}
|
||||
|
||||
void* __wrap__malloc_r(struct _reent* r, size_t size) {
|
||||
UNUSED(r);
|
||||
return pvPortMalloc(size);
|
||||
}
|
||||
|
||||
void __wrap__free_r(struct _reent* r, void* ptr) {
|
||||
UNUSED(r);
|
||||
vPortFree(ptr);
|
||||
}
|
||||
|
||||
void* __wrap__calloc_r(struct _reent* r, size_t count, size_t size) {
|
||||
UNUSED(r);
|
||||
return calloc(count, size);
|
||||
}
|
||||
|
||||
void* __wrap__realloc_r(struct _reent* r, void* ptr, size_t size) {
|
||||
UNUSED(r);
|
||||
return realloc(ptr, size);
|
||||
}
|
||||
|
@@ -205,6 +205,7 @@ static inline void traceMALLOC(void* pointer, size_t size) {
|
||||
|
||||
#undef traceFREE
|
||||
static inline void traceFREE(void* pointer, size_t size) {
|
||||
UNUSED(size);
|
||||
osThreadId_t thread_id = osThreadGetId();
|
||||
if(thread_id && memmgr_heap_thread_trace_depth == 0) {
|
||||
memmgr_heap_thread_trace_depth++;
|
||||
|
@@ -93,9 +93,11 @@ bool furi_stdglue_set_thread_stdout_callback(FuriStdglueWriteCallback callback)
|
||||
}
|
||||
|
||||
void __malloc_lock(struct _reent* REENT) {
|
||||
UNUSED(REENT);
|
||||
vTaskSuspendAll();
|
||||
}
|
||||
|
||||
void __malloc_unlock(struct _reent* REENT) {
|
||||
UNUSED(REENT);
|
||||
xTaskResumeAll();
|
||||
}
|
||||
|
@@ -160,4 +160,4 @@ int32_t furi_thread_get_return_code(FuriThread* thread);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
@@ -55,4 +55,4 @@ bool write_mutex(ValueMutex* valuemutex, void* data, size_t len, uint32_t timeou
|
||||
if(!release_mutex(valuemutex, value)) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -146,4 +146,4 @@ void consumer_app(void* _p) {
|
||||
}
|
||||
}
|
||||
```
|
||||
*/
|
||||
*/
|
||||
|
Reference in New Issue
Block a user