fix clang warnings

amd64-ucontext.h:3:25: warning: redefinition of typedef 'mcontext_t' is a C11 feature
amd64-ucontext.h:4:25: warning: redefinition of typedef 'ucontext_t' is a C11 feature
context.c:86:3: warning: indirection of non-volatile null pointer will be deleted, not trap
This commit is contained in:
David du Colombier 2015-06-14 17:12:51 +02:00
parent 3ae1151187
commit 53021339da
2 changed files with 6 additions and 8 deletions

View File

@ -83,7 +83,7 @@ makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
memset(&ucp->uc_mcontext, 0, sizeof ucp->uc_mcontext);
if(argc != 2)
*(int*)0 = 0;
*(volatile int*)0 = 0;
va_start(va, argc);
ucp->uc_mcontext.mc_rdi = va_arg(va, int);
ucp->uc_mcontext.mc_rsi = va_arg(va, int);

View File

@ -105,19 +105,17 @@ extern void makecontext(ucontext_t*, void(*)(), int, ...);
#endif
#if defined(__linux__) && defined(__amd64__)
typedef struct mcontext mcontext_t;
typedef struct ucontext ucontext_t;
# if defined(__i386__)
# include "386-ucontext.h"
# elif defined(__x86_64__)
# include "amd64-ucontext.h"
# endif
extern int getmcontext(mcontext_t*);
extern void setmcontext(const mcontext_t*);
#define setcontext(u) setmcontext(&(u)->uc_mcontext)
#define getcontext(u) getmcontext(&(u)->uc_mcontext)
extern int swapcontext(ucontext_t*, const ucontext_t*);
extern void makecontext(ucontext_t*, void(*)(), int, ...);
# if defined(__i386__)
# include "386-ucontext.h"
# elif defined(__x86_64__)
# include "amd64-ucontext.h"
# endif
#endif
#if defined(__APPLE__)