diff options
author | Ben Wiederhake <BenWiederhake.GitHub@gmx.de> | 2020-08-10 23:45:11 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-12 20:40:59 +0200 |
commit | 5574d45edabed5b5d7f1a29455bdd5c495a30ae8 (patch) | |
tree | 0e81098035cec9dbdfbe2042c5c78cee34abca48 /DevTools/UserspaceEmulator | |
parent | 84e112be6b967bc9b987ea3f66b5ed8b60faefea (diff) | |
download | serenity-5574d45edabed5b5d7f1a29455bdd5c495a30ae8.zip |
DevTools: 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.
Diffstat (limited to 'DevTools/UserspaceEmulator')
-rw-r--r-- | DevTools/UserspaceEmulator/Emulator.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/DevTools/UserspaceEmulator/Emulator.cpp b/DevTools/UserspaceEmulator/Emulator.cpp index 33f956900a..3878f2854c 100644 --- a/DevTools/UserspaceEmulator/Emulator.cpp +++ b/DevTools/UserspaceEmulator/Emulator.cpp @@ -1124,7 +1124,7 @@ enum class DefaultSignalAction { Continue, }; -DefaultSignalAction default_signal_action(int signal) +static DefaultSignalAction default_signal_action(int signal) { ASSERT(signal && signal < NSIG); @@ -1235,6 +1235,8 @@ void report(const char* format, ...) va_end(ap); } +// Make sure the compiler doesn't "optimize away" this function: +extern void signal_trampoline_dummy(void); void signal_trampoline_dummy(void) { // The trampoline preserves the current eax, pushes the signal code and |