Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/lib/libc/gen/exect sig_atomic_t does not include volat...



details:   https://anonhg.NetBSD.org/src/rev/bcc1a9334920
branches:  trunk
changeset: 349495:bcc1a9334920
user:      joerg <joerg%NetBSD.org@localhost>
date:      Mon Dec 12 10:34:55 2016 +0000

description:
sig_atomic_t does not include volatile. Prevent static analysis from
understanding that the test function is dead.

diffstat:

 tests/lib/libc/gen/exect/t_exect.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r 01fdd4353b51 -r bcc1a9334920 tests/lib/libc/gen/exect/t_exect.c
--- a/tests/lib/libc/gen/exect/t_exect.c        Mon Dec 12 10:13:00 2016 +0000
+++ b/tests/lib/libc/gen/exect/t_exect.c        Mon Dec 12 10:34:55 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: t_exect.c,v 1.5 2016/12/11 03:38:09 kamil Exp $        */
+/*     $NetBSD: t_exect.c,v 1.6 2016/12/12 10:34:55 joerg Exp $        */
 
 /*-
  * Copyright (c) 2014 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
            "Tests an empty exect(2) executing");
 }
 
-static sig_atomic_t caught = 0;
+static volatile sig_atomic_t caught = 0;
 
 static void
 sigtrap_handler(int sig, siginfo_t *info, void *ctx)
@@ -66,8 +66,9 @@
         * designed and implemented and is breaking tests - skip it
         * unconditionally for all ports.
         */
-
-       atf_tc_skip("exect(3) misdesigned and hangs - PR port-amd64/51700");
+       /* Prevent static analysis from requiring t_exec_null to be __dead. */
+       if (!caught) 
+               atf_tc_skip("exect(3) misdesigned and hangs - PR port-amd64/51700");
 
        ATF_REQUIRE(sigemptyset(&act.sa_mask) == 0);
        act.sa_sigaction = sigtrap_handler;



Home | Main Index | Thread Index | Old Index