mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2024-11-25 00:27:39 +01:00
Use `UNUSED' in tests
This commit is contained in:
parent
5e7e890a0b
commit
6b55e0ab51
17 changed files with 76 additions and 55 deletions
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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__);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue