Skip to content

Commit 49ff7d8

Browse files
btw616richardweinberger
authored andcommitted
um: Fix -Wmissing-prototypes warnings for __warp_* and foo
These functions are not called explicitly. Let's just workaround the -Wmissing-prototypes warnings by declaring them locally similar to what was done in arch/x86/kernel/asm-offsets_32.c. This will address below -Wmissing-prototypes warnings: ./arch/x86/um/shared/sysdep/kernel-offsets.h:9:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes] arch/um/os-Linux/main.c:187:7: warning: no previous prototype for ‘__wrap_malloc’ [-Wmissing-prototypes] arch/um/os-Linux/main.c:208:7: warning: no previous prototype for ‘__wrap_calloc’ [-Wmissing-prototypes] arch/um/os-Linux/main.c:222:6: warning: no previous prototype for ‘__wrap_free’ [-Wmissing-prototypes] arch/x86/um/user-offsets.c:17:6: warning: no previous prototype for ‘foo’ [-Wmissing-prototypes] Signed-off-by: Tiwei Bie <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 19cf791 commit 49ff7d8

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

arch/um/os-Linux/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,11 @@ int __init main(int argc, char **argv, char **envp)
184184

185185
extern void *__real_malloc(int);
186186

187+
/* workaround for -Wmissing-prototypes warnings */
188+
void *__wrap_malloc(int size);
189+
void *__wrap_calloc(int n, int size);
190+
void __wrap_free(void *ptr);
191+
187192
void *__wrap_malloc(int size)
188193
{
189194
void *ret;

arch/x86/um/shared/sysdep/kernel-offsets.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
#include <linux/kbuild.h>
77
#include <asm/mman.h>
88

9+
/* workaround for a warning with -Wmissing-prototypes */
10+
void foo(void);
11+
912
void foo(void)
1013
{
1114
#include <common-offsets.h>

arch/x86/um/user-offsets.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
COMMENT(#val " / sizeof(unsigned long)"); \
1515
DEFINE(sym, val / sizeof(unsigned long))
1616

17+
/* workaround for a warning with -Wmissing-prototypes */
18+
void foo(void);
19+
1720
void foo(void)
1821
{
1922
#ifdef __i386__

0 commit comments

Comments
 (0)