Commit 49ff7d87 authored by Tiwei Bie's avatar Tiwei Bie Committed by Richard Weinberger

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: default avatarTiwei Bie <tiwei.btw@antgroup.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 19cf7915
......@@ -184,6 +184,11 @@ int __init main(int argc, char **argv, char **envp)
extern void *__real_malloc(int);
/* workaround for -Wmissing-prototypes warnings */
void *__wrap_malloc(int size);
void *__wrap_calloc(int n, int size);
void __wrap_free(void *ptr);
void *__wrap_malloc(int size)
{
void *ret;
......
......@@ -6,6 +6,9 @@
#include <linux/kbuild.h>
#include <asm/mman.h>
/* workaround for a warning with -Wmissing-prototypes */
void foo(void);
void foo(void)
{
#include <common-offsets.h>
......
......@@ -14,6 +14,9 @@
COMMENT(#val " / sizeof(unsigned long)"); \
DEFINE(sym, val / sizeof(unsigned long))
/* workaround for a warning with -Wmissing-prototypes */
void foo(void);
void foo(void)
{
#ifdef __i386__
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment