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