summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTommi Rantala <tt.rantala@gmail.com>2012-09-19 13:50:59 +0300
committerTommi Rantala <tt.rantala@gmail.com>2012-09-28 14:51:21 +0300
commit6b55e0ab51eee7dbea679fda2b37ecf61f0025e5 (patch)
tree60be8a74148b3681b5daedef9cac8a98ee1b04a7
parent5e7e890a0b75fc9b64838dd197f554c6c6285d88 (diff)
downloadlibunwind-6b55e0ab51eee7dbea679fda2b37ecf61f0025e5.tar.gz
Use `UNUSED' in tests
-rw-r--r--tests/Gtest-bt.c6
-rw-r--r--tests/Gtest-concurrent.c8
-rw-r--r--tests/Gtest-dyn1.c6
-rw-r--r--tests/Gtest-init.cxx3
-rw-r--r--tests/Gtest-resume-sig.c8
-rw-r--r--tests/Gtest-trace.c6
-rw-r--r--tests/Lrs-race.c5
-rw-r--r--tests/Ltest-varargs.c2
-rw-r--r--tests/test-async-sig.c4
-rw-r--r--tests/test-coredump-unwind.c2
-rw-r--r--tests/test-init-remote.c4
-rw-r--r--tests/test-mem.c4
-rw-r--r--tests/test-proc-info.c59
-rw-r--r--tests/test-ptrace-misc.c4
-rw-r--r--tests/test-setjmp.c4
-rw-r--r--tests/test-static-link-loc.c3
-rw-r--r--tests/test-strerror.c3
17 files changed, 76 insertions, 55 deletions
diff --git a/tests/Gtest-bt.c b/tests/Gtest-bt.c
index 4a07c6f1..802dd085 100644
--- a/tests/Gtest-bt.c
+++ b/tests/Gtest-bt.c
@@ -127,7 +127,7 @@ do_backtrace (void)
}
void
-foo (long val __attribute__((unused)))
+foo (long val UNUSED)
{
do_backtrace ();
}
@@ -164,7 +164,7 @@ bar (long v)
}
void
-sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
+sighandler (int signal, void *siginfo UNUSED, void *context)
{
ucontext_t *uc UNUSED;
int sp;
@@ -206,7 +206,7 @@ sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction act;
stack_t stk;
diff --git a/tests/Gtest-concurrent.c b/tests/Gtest-concurrent.c
index b98b6c0b..6f3447fd 100644
--- a/tests/Gtest-concurrent.c
+++ b/tests/Gtest-concurrent.c
@@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# include "config.h"
#endif
+#include "compiler.h"
+
#include <libunwind.h>
#include <limits.h>
#include <pthread.h>
@@ -46,7 +48,7 @@ int got_usr1, got_usr2;
char *sigusr1_sp;
void
-handler (int sig __attribute__((unused)))
+handler (int sig UNUSED)
{
unw_word_t ip;
unw_context_t uc;
@@ -68,7 +70,7 @@ handler (int sig __attribute__((unused)))
}
void *
-worker (void *arg __attribute__((unused)))
+worker (void *arg UNUSED)
{
signal (SIGUSR1, handler);
@@ -102,7 +104,7 @@ doit (void)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/Gtest-dyn1.c b/tests/Gtest-dyn1.c
index 96eb7067..bc7dc9cf 100644
--- a/tests/Gtest-dyn1.c
+++ b/tests/Gtest-dyn1.c
@@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "flush-cache.h"
+#include "compiler.h"
+
#include <libunwind.h>
#include <stdio.h>
#include <stdlib.h>
@@ -157,13 +159,13 @@ sighandler (int signal)
}
int
-dev_null (const char *format __attribute__((unused)), ...)
+dev_null (const char *format UNUSED, ...)
{
return 0;
}
int
-main (int argc, char *argv[] __attribute__((unused)))
+main (int argc, char *argv[] UNUSED)
{
unw_dyn_region_info_t *region;
unw_dyn_info_t di;
diff --git a/tests/Gtest-init.cxx b/tests/Gtest-init.cxx
index 9a3f4828..afded019 100644
--- a/tests/Gtest-init.cxx
+++ b/tests/Gtest-init.cxx
@@ -31,6 +31,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <unistd.h>
#include <libunwind.h>
+#include "compiler.h"
int verbose, errors;
@@ -99,7 +100,7 @@ Test_Class::Test_Class (void)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
verbose = argc > 1;
return atexit (a);
diff --git a/tests/Gtest-resume-sig.c b/tests/Gtest-resume-sig.c
index 57939cdb..55eb00a0 100644
--- a/tests/Gtest-resume-sig.c
+++ b/tests/Gtest-resume-sig.c
@@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# include "config.h"
#endif
+#include "compiler.h"
+
#include <libunwind.h>
#include <signal.h>
#include <stdio.h>
@@ -64,8 +66,8 @@ get_bsp (void)
#ifdef TEST_WITH_SIGINFO
void
handler (int sig,
- siginfo_t *si __attribute__((unused)),
- void *ucontext __attribute__((unused)))
+ siginfo_t *si UNUSED,
+ void *ucontext UNUSED)
#else
void
handler (int sig)
@@ -135,7 +137,7 @@ handler (int sig)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction sa;
float d = 1.0;
diff --git a/tests/Gtest-trace.c b/tests/Gtest-trace.c
index e8dd9894..dcd467b4 100644
--- a/tests/Gtest-trace.c
+++ b/tests/Gtest-trace.c
@@ -139,7 +139,7 @@ do_backtrace (void)
}
void
-foo (long val __attribute__((unused)))
+foo (long val UNUSED)
{
do_backtrace ();
}
@@ -176,7 +176,7 @@ bar (long v)
}
void
-sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
+sighandler (int signal, void *siginfo UNUSED, void *context)
{
ucontext_t *uc UNUSED;
int sp;
@@ -220,7 +220,7 @@ sighandler (int signal, void *siginfo __attribute__((unused)), void *context)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction act;
stack_t stk;
diff --git a/tests/Lrs-race.c b/tests/Lrs-race.c
index 061bd8cd..e39a62bd 100644
--- a/tests/Lrs-race.c
+++ b/tests/Lrs-race.c
@@ -26,6 +26,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define UNW_LOCAL_ONLY
#include <libunwind.h>
+#include "compiler.h"
#include <stdio.h>
#include <pthread.h>
@@ -1333,7 +1334,7 @@ foo_128 (void)
}
void *
-bar(void *p __attribute__((unused)))
+bar(void *p UNUSED)
{
int i;
for (i = 0; i < ITERS; ++i) {
@@ -1487,7 +1488,7 @@ int doit ()
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/Ltest-varargs.c b/tests/Ltest-varargs.c
index dd12c86b..17ac600b 100644
--- a/tests/Ltest-varargs.c
+++ b/tests/Ltest-varargs.c
@@ -64,7 +64,7 @@ a (int d, ...)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/test-async-sig.c b/tests/test-async-sig.c
index 9a0d39e6..2ce8b4bb 100644
--- a/tests/test-async-sig.c
+++ b/tests/test-async-sig.c
@@ -27,6 +27,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include "config.h"
#endif
+#include "compiler.h"
+
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -159,7 +161,7 @@ sighandler (int signal)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct sigaction act;
long i = 0;
diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
index d7c7954b..5254708d 100644
--- a/tests/test-coredump-unwind.c
+++ b/tests/test-coredump-unwind.c
@@ -263,7 +263,7 @@ static void install_sigsegv_handler(void)
}
int
-main(int argc __attribute__((unused)), char **argv)
+main(int argc UNUSED, char **argv)
{
unw_addr_space_t as;
struct UCD_info *ui;
diff --git a/tests/test-init-remote.c b/tests/test-init-remote.c
index 47d9548b..66f2d6a1 100644
--- a/tests/test-init-remote.c
+++ b/tests/test-init-remote.c
@@ -32,6 +32,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
# include "config.h"
#endif
+#include "compiler.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -91,7 +93,7 @@ foo (void)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
verbose = (argc > 1);
diff --git a/tests/test-mem.c b/tests/test-mem.c
index 2a24359a..52c97748 100644
--- a/tests/test-mem.c
+++ b/tests/test-mem.c
@@ -25,6 +25,8 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+#include "compiler.h"
+
#include <libunwind.h>
#include <stdio.h>
#include <stdlib.h>
@@ -82,7 +84,7 @@ consume_some_stack_space (void)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
struct rlimit rlim;
diff --git a/tests/test-proc-info.c b/tests/test-proc-info.c
index e97ef2bb..c4145bc3 100644
--- a/tests/test-proc-info.c
+++ b/tests/test-proc-info.c
@@ -36,6 +36,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <string.h>
#include <libunwind.h>
+#include "compiler.h"
int errors;
@@ -43,20 +44,20 @@ int errors;
{ ++errors; fprintf (stderr, args); return -1; }
static int
-find_proc_info (unw_addr_space_t as __attribute__((unused)),
- unw_word_t ip __attribute__((unused)),
- unw_proc_info_t *pip __attribute__((unused)),
- int need_unwind_info __attribute__((unused)),
- void *arg __attribute__((unused)))
+find_proc_info (unw_addr_space_t as UNUSED,
+ unw_word_t ip UNUSED,
+ unw_proc_info_t *pip UNUSED,
+ int need_unwind_info UNUSED,
+ void *arg UNUSED)
{
return -UNW_ESTOPUNWIND;
}
static int
-access_mem (unw_addr_space_t as __attribute__((unused)),
- unw_word_t addr __attribute__((unused)),
+access_mem (unw_addr_space_t as UNUSED,
+ unw_word_t addr UNUSED,
unw_word_t *valp, int write,
- void *arg __attribute__((unused)))
+ void *arg UNUSED)
{
if (!write)
*valp = 0;
@@ -64,10 +65,10 @@ access_mem (unw_addr_space_t as __attribute__((unused)),
}
static int
-access_reg (unw_addr_space_t as __attribute__((unused)),
- unw_regnum_t regnum __attribute__((unused)),
+access_reg (unw_addr_space_t as UNUSED,
+ unw_regnum_t regnum UNUSED,
unw_word_t *valp, int write,
- void *arg __attribute__((unused)))
+ void *arg UNUSED)
{
if (!write)
*valp = 32;
@@ -75,10 +76,10 @@ access_reg (unw_addr_space_t as __attribute__((unused)),
}
static int
-access_fpreg (unw_addr_space_t as __attribute__((unused)),
- unw_regnum_t regnum __attribute__((unused)),
+access_fpreg (unw_addr_space_t as UNUSED,
+ unw_regnum_t regnum UNUSED,
unw_fpreg_t *valp, int write,
- void *arg __attribute__((unused)))
+ void *arg UNUSED)
{
if (!write)
memset (valp, 0, sizeof (*valp));
@@ -86,37 +87,37 @@ access_fpreg (unw_addr_space_t as __attribute__((unused)),
}
static int
-get_dyn_info_list_addr (unw_addr_space_t as __attribute__((unused)),
- unw_word_t *dilap __attribute__((unused)),
- void *arg __attribute__((unused)))
+get_dyn_info_list_addr (unw_addr_space_t as UNUSED,
+ unw_word_t *dilap UNUSED,
+ void *arg UNUSED)
{
return -UNW_ENOINFO;
}
static void
-put_unwind_info (unw_addr_space_t as __attribute__((unused)),
- unw_proc_info_t *pi __attribute__((unused)),
- void *arg __attribute__((unused)))
+put_unwind_info (unw_addr_space_t as UNUSED,
+ unw_proc_info_t *pi UNUSED,
+ void *arg UNUSED)
{
++errors;
fprintf (stderr, "%s() got called!\n", __FUNCTION__);
}
static int
-resume (unw_addr_space_t as __attribute__((unused)),
- unw_cursor_t *reg __attribute__((unused)),
- void *arg __attribute__((unused)))
+resume (unw_addr_space_t as UNUSED,
+ unw_cursor_t *reg UNUSED,
+ void *arg UNUSED)
{
panic ("%s() got called!\n", __FUNCTION__);
}
static int
-get_proc_name (unw_addr_space_t as __attribute__((unused)),
- unw_word_t ip __attribute__((unused)),
- char *buf __attribute__((unused)),
- size_t buf_len __attribute__((unused)),
- unw_word_t *offp __attribute__((unused)),
- void *arg __attribute__((unused)))
+get_proc_name (unw_addr_space_t as UNUSED,
+ unw_word_t ip UNUSED,
+ char *buf UNUSED,
+ size_t buf_len UNUSED,
+ unw_word_t *offp UNUSED,
+ void *arg UNUSED)
{
panic ("%s() got called!\n", __FUNCTION__);
}
diff --git a/tests/test-ptrace-misc.c b/tests/test-ptrace-misc.c
index fbbec9c0..374059dc 100644
--- a/tests/test-ptrace-misc.c
+++ b/tests/test-ptrace-misc.c
@@ -23,6 +23,8 @@ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
+#include "compiler.h"
+
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
@@ -104,7 +106,7 @@ bar (int v)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
int val = argc;
diff --git a/tests/test-setjmp.c b/tests/test-setjmp.c
index 30545749..769b71b2 100644
--- a/tests/test-setjmp.c
+++ b/tests/test-setjmp.c
@@ -23,6 +23,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/* The setjmp()/longjmp(), sigsetjmp()/siglongjmp(). */
+#include "compiler.h"
+
#include <setjmp.h>
#include <signal.h>
#include <stdio.h>
@@ -139,7 +141,7 @@ sighandler (int signal)
}
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
volatile sigset_t sigset1, sigset2, sigset3;
volatile struct sigaction act;
diff --git a/tests/test-static-link-loc.c b/tests/test-static-link-loc.c
index ed94f556..4e47e45f 100644
--- a/tests/test-static-link-loc.c
+++ b/tests/test-static-link-loc.c
@@ -33,6 +33,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#define UNW_LOCAL_ONLY
#include <libunwind.h>
+#include "compiler.h"
extern int test_generic (void);
@@ -87,7 +88,7 @@ test_local (void)
#endif /* !UNW_REMOTE_ONLY */
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
if (argc > 1)
verbose = 1;
diff --git a/tests/test-strerror.c b/tests/test-strerror.c
index 44709524..f7ae61ed 100644
--- a/tests/test-strerror.c
+++ b/tests/test-strerror.c
@@ -1,8 +1,9 @@
+#include "compiler.h"
#include <libunwind.h>
#include <stdio.h>
int
-main (int argc, char **argv __attribute__((unused)))
+main (int argc, char **argv UNUSED)
{
int i, verbose = argc > 1;
const char *msg;