]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
test-runner: Fix compiler warning
authorTobias Brunner <tobias@strongswan.org>
Fri, 15 Jul 2022 11:01:29 +0000 (13:01 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 18 Jul 2022 10:42:24 +0000 (12:42 +0200)
Making the variable volatile avoids a "variable ‘failure’ might be
clobbered by ‘longjmp’" warning (or error when compiling with
-Werror) that's triggered via -Wextra.

src/libstrongswan/tests/test_runner.c

index 6d83d83a8e69474abb0d66b7987e49325d449a7c..71da513f0f40e4eb5ab9881fa03ea9beb4fb861a 100644 (file)
@@ -289,7 +289,7 @@ static bool call_fixture(test_case_t *tcase, bool up, int i)
 {
        enumerator_t *enumerator;
        test_fixture_t *fixture;
-       bool failure = FALSE;
+       volatile bool failure = FALSE;
 
        enumerator = array_create_enumerator(tcase->fixtures);
        while (enumerator->enumerate(enumerator, &fixture))