@@ -30,6 +30,8 @@ SOFTWARE.
30
30
#include <stdlib.h>
31
31
#include <assert.h>
32
32
33
+ #define MAYBE_UNUSED (arg ) (void)(arg)
34
+
33
35
#if (defined(CERAII_GCC_COMPILER ) || defined(CERAII_CLANG_COMPILER ))
34
36
35
37
#include <pthread.h>
@@ -78,6 +80,7 @@ void* thread_1_func(void *arg)
78
80
marker2 [thread_nuber ] = 0 ;
79
81
marker3 [thread_nuber ] = 0 ;
80
82
int result = base_multiple_return_100 (thread_nuber );
83
+ MAYBE_UNUSED (result );
81
84
assert (result == 100 );
82
85
assert (marker1 [thread_nuber ] = 1 );
83
86
assert (marker3 [thread_nuber ] = 2 );
@@ -96,6 +99,7 @@ void* thread_2_func(void *arg)
96
99
marker2 [thread_nuber ] = 0 ;
97
100
marker3 [thread_nuber ] = 0 ;
98
101
int result = base_multiple_return_100 (thread_nuber );
102
+ MAYBE_UNUSED (result );
99
103
assert (result == 100 );
100
104
assert (marker1 [thread_nuber ] = 1 );
101
105
assert (marker3 [thread_nuber ] = 2 );
@@ -114,6 +118,7 @@ void* thread_3_func(void *arg)
114
118
marker2 [thread_nuber ] = 0 ;
115
119
marker3 [thread_nuber ] = 0 ;
116
120
int result = base_multiple_return_100 (thread_nuber );
121
+ MAYBE_UNUSED (result );
117
122
assert (result == 100 );
118
123
assert (marker1 [thread_nuber ] = 1 );
119
124
assert (marker3 [thread_nuber ] = 2 );
@@ -132,6 +137,7 @@ void* thread_func(void *arg)
132
137
marker2 [thread_number ] = 0 ;
133
138
marker3 [thread_number ] = 0 ;
134
139
int result = base_multiple_return_100 (thread_number );
140
+ MAYBE_UNUSED (result );
135
141
assert (result == 100 );
136
142
assert (marker1 [thread_number ] = 1 );
137
143
assert (marker3 [thread_number ] = 2 );
@@ -142,8 +148,8 @@ void* thread_func(void *arg)
142
148
143
149
int main (int argc , char * argv [])
144
150
{
145
- ( void ) argc ;
146
- ( void ) argv ;
151
+ MAYBE_UNUSED ( argc ) ;
152
+ MAYBE_UNUSED ( argv ) ;
147
153
148
154
/*
149
155
* Test threads that run independent functions with CERAII macros
@@ -215,8 +221,8 @@ int main(int argc, char *argv[])
215
221
#else
216
222
int main (int argc , char * argv [])
217
223
{
218
- ( void ) argc ;
219
- ( void ) argv ;
224
+ MAYBE_UNUSED ( argc ) ;
225
+ MAYBE_UNUSED ( argv ) ;
220
226
221
227
return (0 );
222
228
}
0 commit comments