Skip to content

Commit 21fbc25

Browse files
committed
[F] Fix compilation error
1 parent 8f976f3 commit 21fbc25

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ matrix:
1919
- os: linux
2020
compiler: clang
2121
env:
22-
- BUILD_TYPE=Release
22+
- BUILD_TYPE=Debug
2323
- os: linux
2424
compiler: clang
2525
env:
26-
- BUILD_TYPE=Debug
26+
- BUILD_TYPE=Release
2727

2828

2929
script:

tests/multi_threads.c

+10-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ SOFTWARE.
3030
#include <stdlib.h>
3131
#include <assert.h>
3232

33+
#define MAYBE_UNUSED(arg) (void)(arg)
34+
3335
#if (defined(CERAII_GCC_COMPILER) || defined(CERAII_CLANG_COMPILER))
3436

3537
#include <pthread.h>
@@ -78,6 +80,7 @@ void* thread_1_func(void *arg)
7880
marker2[thread_nuber] = 0;
7981
marker3[thread_nuber] = 0;
8082
int result = base_multiple_return_100(thread_nuber);
83+
MAYBE_UNUSED(result);
8184
assert(result == 100);
8285
assert(marker1[thread_nuber] = 1);
8386
assert(marker3[thread_nuber] = 2);
@@ -96,6 +99,7 @@ void* thread_2_func(void *arg)
9699
marker2[thread_nuber] = 0;
97100
marker3[thread_nuber] = 0;
98101
int result = base_multiple_return_100(thread_nuber);
102+
MAYBE_UNUSED(result);
99103
assert(result == 100);
100104
assert(marker1[thread_nuber] = 1);
101105
assert(marker3[thread_nuber] = 2);
@@ -114,6 +118,7 @@ void* thread_3_func(void *arg)
114118
marker2[thread_nuber] = 0;
115119
marker3[thread_nuber] = 0;
116120
int result = base_multiple_return_100(thread_nuber);
121+
MAYBE_UNUSED(result);
117122
assert(result == 100);
118123
assert(marker1[thread_nuber] = 1);
119124
assert(marker3[thread_nuber] = 2);
@@ -132,6 +137,7 @@ void* thread_func(void *arg)
132137
marker2[thread_number] = 0;
133138
marker3[thread_number] = 0;
134139
int result = base_multiple_return_100(thread_number);
140+
MAYBE_UNUSED(result);
135141
assert(result == 100);
136142
assert(marker1[thread_number] = 1);
137143
assert(marker3[thread_number] = 2);
@@ -142,8 +148,8 @@ void* thread_func(void *arg)
142148

143149
int main(int argc, char *argv[])
144150
{
145-
(void)argc;
146-
(void)argv;
151+
MAYBE_UNUSED(argc);
152+
MAYBE_UNUSED(argv);
147153

148154
/*
149155
* Test threads that run independent functions with CERAII macros
@@ -215,8 +221,8 @@ int main(int argc, char *argv[])
215221
#else
216222
int main(int argc, char *argv[])
217223
{
218-
(void)argc;
219-
(void)argv;
224+
MAYBE_UNUSED(argc);
225+
MAYBE_UNUSED(argv);
220226

221227
return (0);
222228
}

0 commit comments

Comments
 (0)