From a0c721b30dbcf6b1fab0c1acc3f9669e6d326983 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Wed, 19 Oct 2022 14:35:11 +0200 Subject: [PATCH] Forced suppression of some compiler warnings in miosix kernel sources --- lib/miosix-kernel/miosix/kernel/kernel.cpp | 3 +++ lib/miosix-kernel/miosix/kernel/logging.h | 3 +++ lib/miosix-kernel/miosix/kernel/stage_2_boot.cpp | 5 +++++ 3 files changed, 11 insertions(+) diff --git a/lib/miosix-kernel/miosix/kernel/kernel.cpp b/lib/miosix-kernel/miosix/kernel/kernel.cpp index b0b8aa7e..297a9681 100644 --- a/lib/miosix-kernel/miosix/kernel/kernel.cpp +++ b/lib/miosix-kernel/miosix/kernel/kernel.cpp @@ -325,6 +325,8 @@ Thread *Thread::create(void *(*startfunc)(void *), unsigned int stacksize, return thread; } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wcast-function-type" Thread *Thread::create(void (*startfunc)(void *), unsigned int stacksize, Priority priority, void *argv, unsigned short options) { @@ -332,6 +334,7 @@ Thread *Thread::create(void (*startfunc)(void *), unsigned int stacksize, return Thread::create(reinterpret_cast(startfunc), stacksize,priority,argv,options); } +#pragma GCC diagnostic pop void Thread::yield() { diff --git a/lib/miosix-kernel/miosix/kernel/logging.h b/lib/miosix-kernel/miosix/kernel/logging.h index 4b0ed676..aaabc430 100644 --- a/lib/miosix-kernel/miosix/kernel/logging.h +++ b/lib/miosix-kernel/miosix/kernel/logging.h @@ -28,11 +28,14 @@ #ifndef LOGGING_H #define LOGGING_H +#pragma GCC system_header + #include "config/miosix_settings.h" #include "filesystem/console/console_device.h" #include #include + /** * Print boot logs. Contrary to (i)printf(), this can be disabled in * miosix_settings.h if boot logs are not wanted. Can only be called when the diff --git a/lib/miosix-kernel/miosix/kernel/stage_2_boot.cpp b/lib/miosix-kernel/miosix/kernel/stage_2_boot.cpp index cbd6d6c2..57b552b8 100644 --- a/lib/miosix-kernel/miosix/kernel/stage_2_boot.cpp +++ b/lib/miosix-kernel/miosix/kernel/stage_2_boot.cpp @@ -69,6 +69,9 @@ static void callConstructors(unsigned long *start, unsigned long *end) } } +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpedantic" + void *mainLoader(void *argv) { (void) argv; @@ -113,6 +116,8 @@ void *mainLoader(void *argv) return 0; } +#pragma GCC diagnostic pop + } //namespace miosix extern "C" void _init()