summaryrefslogtreecommitdiff
path: root/Kernel/Thread.cpp
diff options
context:
space:
mode:
authorBen Wiederhake <BenWiederhake.GitHub@gmx.de>2020-08-10 21:12:13 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-12 20:40:59 +0200
commit42b057b0c965979f21b5ee58a6f22d0db251bcfb (patch)
tree903b091cf4cdf2830b09e435000b364a82cafeb9 /Kernel/Thread.cpp
parentb1e8807bc526b729817957136a7434ac572a951e (diff)
downloadserenity-42b057b0c965979f21b5ee58a6f22d0db251bcfb.zip
Kernel: Mark compilation-unit-only functions as static
This enables a nice warning in case a function becomes dead code. Also, in case of signal_trampoline_dummy, marking it external (non-static) prevents it from being 'optimized away', which would lead to surprising and weird linker errors. I found these places by using -Wmissing-declarations. The Kernel still shows these issues, which I think are false-positives, but don't want to touch: - Kernel/Arch/i386/CPU.cpp:1081:17: void Kernel::enter_thread_context(Kernel::Thread*, Kernel::Thread*) - Kernel/Arch/i386/CPU.cpp:1170:17: void Kernel::context_first_init(Kernel::Thread*, Kernel::Thread*, Kernel::TrapFrame*) - Kernel/Arch/i386/CPU.cpp:1304:16: u32 Kernel::do_init_context(Kernel::Thread*, u32) - Kernel/Arch/i386/CPU.cpp:1347:17: void Kernel::pre_init_finished() - Kernel/Arch/i386/CPU.cpp:1360:17: void Kernel::post_init_finished() No idea, not gonna touch it. - Kernel/init.cpp:104:30: void Kernel::init() - Kernel/init.cpp:167:30: void Kernel::init_ap(u32, Kernel::Processor*) - Kernel/init.cpp:184:17: void Kernel::init_finished(u32) Called by boot.S. - Kernel/init.cpp:383:16: int Kernel::__cxa_atexit(void (*)(void*), void*, void*) - Kernel/StdLib.cpp:285:19: void __cxa_pure_virtual() - Kernel/StdLib.cpp:300:19: void __stack_chk_fail() - Kernel/StdLib.cpp:305:19: void __stack_chk_fail_local() Not sure how to tell the compiler that the compiler is already using them. Also, maybe __cxa_atexit should go into StdLib.cpp? - Kernel/Modules/TestModule.cpp:31:17: void module_init() - Kernel/Modules/TestModule.cpp:40:17: void module_fini() Could maybe go into a new header. This would also provide type-checking for new modules.
Diffstat (limited to 'Kernel/Thread.cpp')
-rw-r--r--Kernel/Thread.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Kernel/Thread.cpp b/Kernel/Thread.cpp
index ac654db1b2..31b409dd47 100644
--- a/Kernel/Thread.cpp
+++ b/Kernel/Thread.cpp
@@ -359,7 +359,7 @@ enum class DefaultSignalAction {
Continue,
};
-DefaultSignalAction default_signal_action(u8 signal)
+static DefaultSignalAction default_signal_action(u8 signal)
{
ASSERT(signal && signal < NSIG);