From bb588729ffb0fa2d1e3bb6acfd5ca288455c54bc Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 25 Nov 2005 19:02:16 +0100 Subject: [PATCH] Silence various sparse warnings ... related to __INT_MAX__ and friends not being defined, and various __builtin.. function declarations missing (they should probably be added to sparse, but I am lazy). --- src/osdep/stub.h | 15 +++++++++++++++ src/osdep/types.h | 11 +++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/osdep/stub.h b/src/osdep/stub.h index 6e807b4e..378ab55f 100644 --- a/src/osdep/stub.h +++ b/src/osdep/stub.h @@ -3,6 +3,7 @@ #include #include + #if 0 #ifdef CONFIG_DEBUG #define CONFIG_OWN_LIBC @@ -144,4 +145,18 @@ int elinks_raise(int signal); const char *elinks_inet_ntop(int af, const void *src, char *dst, size_t size); #endif +/* Silence various sparse warnings. */ + +#ifndef __builtin_stpcpy +extern char *__builtin_stpcpy(char *dest, const char *src); +#endif + +#ifndef __builtin_mempcpy +extern void *__builtin_mempcpy(void *dest, const void *src, size_t n); +#endif + +#ifndef __builtin_va_copy +#define __builtin_va_copy(dest, src) do { dest = src; } while (0) +#endif + #endif diff --git a/src/osdep/types.h b/src/osdep/types.h index d4ff0aee..db55149e 100644 --- a/src/osdep/types.h +++ b/src/osdep/types.h @@ -107,4 +107,15 @@ typedef unsigned long long uint32_t; #define longlong long #endif +/* These are mostly for shutting up sparse warnings. */ +#ifndef __INT_MAX__ +#define __INT_MAX__ 0x7fffffff +#endif +#ifndef __LONG_MAX__ +#define __LONG_MAX__ 0x7fffffff +#endif +#ifndef __SHRT_MAX__ +#define __SHRT_MAX__ 0x7fff +#endif + #endif