]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Fix compiler warnings on Solaris 12 about assigning a function pointer
authorIvo Raisr <ivosh@ivosh.net>
Sun, 17 Apr 2016 19:28:04 +0000 (19:28 +0000)
committerIvo Raisr <ivosh@ivosh.net>
Sun, 17 Apr 2016 19:28:04 +0000 (19:28 +0000)
of an incompatible type to signal handler.
Untyped function pointer sa_handler() is no longer available
so we leverage sa_sigaction(int, siginfo_t *, void *) instead.
n-i-bz

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15858

21 files changed:
memcheck/tests/amd64-solaris/context_fpu.c
memcheck/tests/amd64-solaris/context_fpu.stderr.exp
memcheck/tests/amd64-solaris/context_gpr.c
memcheck/tests/amd64-solaris/context_gpr.stderr.exp
memcheck/tests/amd64-solaris/context_rflags.c
memcheck/tests/amd64-solaris/context_rflags2.c
memcheck/tests/amd64-solaris/context_rflags2.stderr.exp
memcheck/tests/amd64-solaris/context_sse.c
memcheck/tests/amd64-solaris/context_sse.stderr.exp
memcheck/tests/solaris/context_stack_die.c
memcheck/tests/solaris/context_stack_die.stderr.exp
memcheck/tests/x86-solaris/context_eflags.c
memcheck/tests/x86-solaris/context_eflags2.c
memcheck/tests/x86-solaris/context_eflags2.stderr.exp
memcheck/tests/x86-solaris/context_fpu.c
memcheck/tests/x86-solaris/context_fpu.stderr.exp
memcheck/tests/x86-solaris/context_gpr.c
memcheck/tests/x86-solaris/context_gpr.stderr.exp
memcheck/tests/x86-solaris/context_sse.c
memcheck/tests/x86-solaris/context_sse.stderr.exp
none/tests/solaris/context_link2.c

index 08f8347924a90d7e39ec4851e78e7f81d933b5f8..694a6b9ea2915ef474a360cbcff7f616b0db7780 100644 (file)
@@ -14,9 +14,10 @@ static siginfo_t si;
 static ucontext_t uc;
 static float inhandler[8];
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
    int i;
+   ucontext_t *ucp = (ucontext_t *) arg;
 
    si = *sip;
    uc = *ucp;
@@ -50,7 +51,7 @@ int main(void)
    float *px = malloc(sizeof(*px));
    x0 = px[0];
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index 46c87312a394d3b6a09dad8acffa63f28685fe19..f47b33860614fdd0d710ffe7b82cb4471b57947c 100644 (file)
@@ -1,96 +1,96 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:96)
+   at 0x........: main (context_fpu.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:104)
+   at 0x........: main (context_fpu.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:50)
+   by 0x........: main (context_fpu.c:51)
 
index 313259756192dba60b56a89e2384ef17878eade7..25d4ce5c9702eabfdd6cf05835ba48c04fc94d1f 100644 (file)
@@ -18,8 +18,10 @@ static long x0;
 
 void break_out(void);
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
+   ucontext_t *ucp = (ucontext_t *) arg;
+
    si = *sip;
    uc = *ucp;
 
@@ -43,7 +45,7 @@ int main(void)
    long *py = malloc(sizeof(*py));
    y0 = py[0];
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index 5b922d540e920852276f846b67ac7981f3c4e292..6913c55b37ab58541647913552ede599800b6c48 100644 (file)
@@ -1,18 +1,18 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_gpr.c:84)
+   at 0x........: main (context_gpr.c:86)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_gpr.c:43)
+   by 0x........: main (context_gpr.c:45)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_gpr.c:91)
+   at 0x........: main (context_gpr.c:93)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_gpr.c:43)
+   by 0x........: main (context_gpr.c:45)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_gpr.c:91)
+   at 0x........: main (context_gpr.c:93)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_gpr.c:39)
+   by 0x........: main (context_gpr.c:41)
 
index 6d36d5f65c7d207f17e8a427842e015fae536509..c44a1c62c644e4fc2a6a7256fd60496a3b5030aa 100644 (file)
 static siginfo_t si;
 static ucontext_t uc;
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
    si = *sip;
-   uc = *ucp;
+   uc = *((ucontext_t *) arg);
 }
 
 int main(void)
@@ -29,7 +29,7 @@ int main(void)
    pid_t pid;
    long rflags;
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index 14d59284e806fa7cb525e20b3a0e1a7082a0a9d0..62ef9dd92a78785a5b85dc42ab420f298a9d450f 100644 (file)
@@ -26,8 +26,10 @@ static ucontext_t uc;
 
 void break_out(void);
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
+   ucontext_t *ucp = (ucontext_t *) arg;
+
    si = *sip;
    uc = *ucp;
 
@@ -45,7 +47,7 @@ int main(void)
    int *px = malloc(sizeof(*px));
    x1 = px[0] + 1;
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index 224ae117e6a905c0aa970c2a389eb3e6bbd017f8..a2d659bcdb0de68ab253a38f5ad150a02336ef2f 100644 (file)
@@ -1,12 +1,12 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_rflags2.c:86)
+   at 0x........: main (context_rflags2.c:88)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_rflags2.c:45)
+   by 0x........: main (context_rflags2.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_rflags2.c:86)
+   at 0x........: main (context_rflags2.c:88)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_rflags2.c:45)
+   by 0x........: main (context_rflags2.c:47)
 
index fa9368d72e96a6cd0c57b6c3c8dd437d5e54863c..396950156f0f7873794165ec8b24413c178ee2d8 100644 (file)
@@ -18,8 +18,10 @@ static ucontext_t uc;
 static upad128_t x0;
 static upad128_t d0 = {0};
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
+   ucontext_t *ucp = (ucontext_t *) arg;
+
    si = *sip;
    uc = *ucp;
 
@@ -49,7 +51,7 @@ int main(void)
    upad128_t *py = malloc(sizeof(*py));
    y0 = py[0];
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index df169c30b2e13b37472e35f445c2ea4bbad6c5f1..eb45ec8c73bcf5df4cd773aabb97a2c6bde95452 100644 (file)
@@ -1,96 +1,96 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:95)
+   at 0x........: main (context_sse.c:97)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:45)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:45)
+   by 0x........: main (context_sse.c:47)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:103)
+   at 0x........: main (context_sse.c:105)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:49)
+   by 0x........: main (context_sse.c:51)
 
index 8673a91554566f5fbeeaaeec62d3e9d79a039a9b..dd2ba43f5c41eb46604b7a6a7f3fcadd96b5373b 100644 (file)
@@ -7,8 +7,9 @@
 
 static volatile int *sp;
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
+   ucontext_t *ucp = (ucontext_t *) arg;
    sp = (int *) &ucp->uc_mcontext.gregs[0];
 }
 
@@ -20,7 +21,7 @@ int main(void)
    volatile int zero = 0;
 
    /* Setup a signal handler. */
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index 556123ed4820caf1039f0dc9da33a966217ab2d0..4bfa397e4f1c3f6748847c49c2295ad632ede533 100644 (file)
@@ -1,5 +1,5 @@
 Invalid read of size 4
-   at 0x........: main (context_stack_die.c:38)
+   at 0x........: main (context_stack_die.c:39)
  Address 0x........ is on thread 1's stack
  .... bytes below stack pointer
 
index 4f363f565541906cc8cfc09c2ff179b9898916c8..c458756875d40985341e19001568d39511ba273c 100644 (file)
 static siginfo_t si;
 static ucontext_t uc;
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
    si = *sip;
-   uc = *ucp;
+   uc = *((ucontext_t *) arg);
 }
 
 int main(void)
@@ -27,7 +27,7 @@ int main(void)
    pid_t pid;
    int eflags;
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index c4c0f2562ca607ae2a3b5f5bb101eb51dc55703a..b675e0103c02eed2c9c61f478c14c30cd9e11e01 100644 (file)
@@ -17,8 +17,10 @@ static ucontext_t uc;
 
 void break_out(void);
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
+   ucontext_t *ucp = (ucontext_t *) arg;
+
    si = *sip;
    uc = *ucp;
 
@@ -36,7 +38,7 @@ int main(void)
    int *px = malloc(sizeof(*px));
    x1 = px[0] + 1;
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index 1b38c3bc59fc90cbbf3e2e57b37ed78c55911faa..46095b2745e8176c65f40265cc7bb06237cb6eed 100644 (file)
@@ -1,12 +1,12 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_eflags2.c:76)
+   at 0x........: main (context_eflags2.c:78)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_eflags2.c:36)
+   by 0x........: main (context_eflags2.c:38)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_eflags2.c:76)
+   at 0x........: main (context_eflags2.c:78)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_eflags2.c:36)
+   by 0x........: main (context_eflags2.c:38)
 
index 6d618ff746c6d8f77c32dc1522a2ef14358cd6a1..aa616a68056ab777358367490d91a907b32bfac6 100644 (file)
@@ -12,9 +12,10 @@ static siginfo_t si;
 static ucontext_t uc;
 static float inhandler[8];
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
    int i;
+   ucontext_t *ucp = (ucontext_t *) arg;
 
    si = *sip;
    uc = *ucp;
@@ -49,7 +50,7 @@ int main(void)
    float *px = malloc(sizeof(*px));
    x0 = px[0];
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index d7700976844fe1b203c3485bce49f67bd17855ad..d7a4d58ca2da5918e2f9856053e212b0fb505fc7 100644 (file)
@@ -1,96 +1,96 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:103)
+   at 0x........: main (context_fpu.c:104)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_fpu.c:111)
+   at 0x........: main (context_fpu.c:112)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_fpu.c:49)
+   by 0x........: main (context_fpu.c:50)
 
index 809506f034f0116f81ea8e63943643f41ecc4b19..13e651adc0a423a95b003f9ed9323b5cb2fa502a 100644 (file)
@@ -14,8 +14,10 @@ static ucontext_t uc;
 /* x0 is always zero, but is visible to Valgrind as uninitialised. */
 static int x0;
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
+   ucontext_t *ucp = (ucontext_t *) arg;
+
    si = *sip;
    uc = *ucp;
 
@@ -37,7 +39,7 @@ int main(void)
    int *py = malloc(sizeof(*py));
    y0 = py[0];
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index a77decacd546fed6340b684d882656ee3730fa7c..8f7d964142060fd36018e678ca7a8eef73f0e045 100644 (file)
@@ -1,18 +1,18 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_gpr.c:81)
+   at 0x........: main (context_gpr.c:83)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_gpr.c:37)
+   by 0x........: main (context_gpr.c:39)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_gpr.c:88)
+   at 0x........: main (context_gpr.c:90)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_gpr.c:37)
+   by 0x........: main (context_gpr.c:39)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_gpr.c:88)
+   at 0x........: main (context_gpr.c:90)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_gpr.c:33)
+   by 0x........: main (context_gpr.c:35)
 
index ed30120347deedd54a00d18794d17b287250aed5..ae123b60915bf757785345c2a9868801a439a601 100644 (file)
@@ -16,8 +16,10 @@ static ucontext_t uc;
 static upad128_t x0;
 static upad128_t d0 = {0};
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
+   ucontext_t *ucp = (ucontext_t *) arg;
+
    si = *sip;
    uc = *ucp;
 
@@ -47,7 +49,7 @@ int main(void)
    upad128_t *py = malloc(sizeof(*py));
    y0 = py[0];
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");
index 65fdb447bd58c9eb4f80818dc5d7ff89a34d653e..0625bc69a59fbf518781cc5bd4df4d962dc4f74a 100644 (file)
@@ -1,96 +1,96 @@
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:101)
+   at 0x........: main (context_sse.c:103)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:43)
+   by 0x........: main (context_sse.c:45)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:43)
+   by 0x........: main (context_sse.c:45)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
 Conditional jump or move depends on uninitialised value(s)
-   at 0x........: main (context_sse.c:109)
+   at 0x........: main (context_sse.c:111)
  Uninitialised value was created by a heap allocation
    at 0x........: malloc (vg_replace_malloc.c:...)
-   by 0x........: main (context_sse.c:47)
+   by 0x........: main (context_sse.c:49)
 
index 9d64b6b5eedf75c06d53a85cc77a0d3024afd795..7979b73e06d6329a8b4b85c080a4181567c99d65 100644 (file)
@@ -5,13 +5,13 @@
 #include <stdio.h>
 #include <ucontext.h>
 
-static void sighandler(int sig, siginfo_t *sip, ucontext_t *ucp)
+static void sighandler(int sig, siginfo_t *sip, void *arg)
 {
    ucontext_t uc2;
 
-   /* Current uc_link value has to be equal to ucp. */
+   /* Current uc_link value has to be equal to (ucontext_t *) arg. */
    getcontext(&uc2);
-   assert(uc2.uc_link == ucp);
+   assert(uc2.uc_link == arg);
 }
 
 int main(void)
@@ -26,7 +26,7 @@ int main(void)
    }
    assert(!uc.uc_link);
 
-   sa.sa_handler = sighandler;
+   sa.sa_sigaction = sighandler;
    sa.sa_flags = SA_SIGINFO;
    if (sigfillset(&sa.sa_mask)) {
       perror("sigfillset");