This change seems to have broken building on 32-bit platforms (certainly at
least for 32-bit ARM):
# compile sys/t_ptrace_wait.o
/nbsd/tools/bin/armv6--netbsdelf-eabihf-gcc -O2 -std=gnu99 -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-sign-compare
-Wsystem-headers -Wno-traditional -Wa,--fatal-warnings -Wreturn-type
-Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter
-Wno-sign-compare -Wsign-compare -Wformat=2 -Wno-format-zero-length -Werror
-Wno-missing-noreturn -fPIE --sysroot=/nbsd/destdir/rpi
-I/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/../../.. -c
-D_KERNTYPES
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.c
In file included from
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.c:59:0:
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h: In
function 'trigger_bus':
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:561:20:
error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
FORKEE_ASSERT_NEQ((uintmax_t)fp, (uintmax_t)NULL);
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:158:18:
note: in definition of macro 'FORKEE_ASSERT_NEQ'
uintmax_t vx = (x); \
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:561:35:
error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
FORKEE_ASSERT_NEQ((uintmax_t)fp, (uintmax_t)NULL);
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:159:18:
note: in definition of macro 'FORKEE_ASSERT_NEQ'
uintmax_t vy = (y); \
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:565:20:
error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
FORKEE_ASSERT_NEQ((uintmax_t)p, (uintmax_t)MAP_FAILED);
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:158:18:
note: in definition of macro 'FORKEE_ASSERT_NEQ'
uintmax_t vx = (x); \
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:565:34:
error: cast from pointer to integer of different size
[-Werror=pointer-to-int-cast]
FORKEE_ASSERT_NEQ((uintmax_t)p, (uintmax_t)MAP_FAILED);
^
/Users/thorpej/NetBSD/current/src/tests/lib/libc/sys/t_ptrace_wait.h:159:18:
note: in definition of macro 'FORKEE_ASSERT_NEQ'
uintmax_t vy = (y); \
^
cc1: all warnings being treated as errors
*** Failed target: t_ptrace_wait.o
Maybe uintptr_t is a better type to cast to?
> On May 23, 2018, at 6:18 AM, Kamil Rytarowski <[email protected]> wrote:
>
> Module Name: src
> Committed By: kamil
> Date: Wed May 23 13:18:09 UTC 2018
>
> Modified Files:
> src/tests/lib/libc/sys: t_ptrace_wait.h
>
> Log Message:
> Add new auxiliary functions in ATF ptrace(2) tests
>
> Introduce:
> - trigger_trap()
> - trigger_segv()
> - trigger_ill()
> - trigger_fpe()
> - trigger_bus()
>
> These functions generate appropriate signals caused by crashes.
>
> A debugger is required to collect the crashes regardless of signal masking,
> catching or ignoring rules.
>
> While there, append __used argument to can_we_set_dbregs().
>
> Sponsored by <The NetBSD Foundation>
>
>
> To generate a diff of this commit:
> cvs rdiff -u -r1.5 -r1.6 src/tests/lib/libc/sys/t_ptrace_wait.h
>
> Please note that diffs are not public domain; they are subject to the
> copyright notices on the relevant files.
>
-- thorpej