mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +00:00
LibC: Mark compilation-unit-only functions as static
This enables a nice warning in case a function becomes dead code. For example with the unused function malloc_good_size() :^) 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: - Libraries/LibC/crt0.cpp:41:5: int _start(int, char**, char**) Not sure how to handle this. - Libraries/LibC/cxxabi.cpp:48:5: int __cxa_atexit(AtExitFunction, void*, void*) - Libraries/LibC/cxxabi.cpp:58:6: void __cxa_finalize(void*) Not sure how to tell the compiler that the compiler is already using them. - Libraries/LibC/libcinit.cpp:36:6: void __libc_init() - Libraries/LibC/libcinit.cpp:55:19: void __stack_chk_fail() - Libraries/LibC/malloc.cpp:430:6: void __malloc_init() - Libraries/LibC/stdio.cpp:562:6: void __stdio_init() These are ninja-imported by other LibC functions. Maybe we should have some kind of "internals.h" header.
This commit is contained in:
parent
69a0502f80
commit
f7fe63c6b0
3 changed files with 4 additions and 13 deletions
|
@ -61,7 +61,7 @@ static const char* determine_base(const char* p, int& base)
|
|||
static int _atob(unsigned long* vp, const char* p, int base)
|
||||
{
|
||||
unsigned long value, v1, v2;
|
||||
const char *q;
|
||||
const char* q;
|
||||
char tmp[20];
|
||||
int digit;
|
||||
|
||||
|
@ -106,7 +106,7 @@ static int _atob(unsigned long* vp, const char* p, int base)
|
|||
return 1;
|
||||
}
|
||||
|
||||
int atob(unsigned int* vp, const char* p, int base)
|
||||
static int atob(unsigned int* vp, const char* p, int base)
|
||||
{
|
||||
unsigned long v;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue