From: Eugene Syromyatnikov Date: Sun, 13 Nov 2016 16:14:46 +0000 (+0300) Subject: tests: fix "constant is too large" compilation warnings X-Git-Tag: v4.15~134 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13c467bf694bffcec4660a0dced41ca06ffb2512;p=strace tests: fix "constant is too large" compilation warnings alarm.c: In function 'main': alarm.c:41: warning: integer constant is too large for 'long' type aio.c: In function 'main': aio.c:162: warning: integer constant is too large for 'long' type btrfs.c: In function 'btrfs_test_sync_ioctls': btrfs.c:202: warning: integer constant is too large for 'long' type btrfs.c: In function 'btrfs_test_subvol_ioctls': btrfs.c:289: warning: integer constant is too large for 'long' type btrfs.c:290: warning: integer constant is too large for 'long' type dup2.c: In function 'main': dup2.c:12: warning: integer constant is too large for 'long' type dup2.c:13: warning: integer constant is too large for 'long' type dup3.c: In function 'main': dup3.c:13: warning: integer constant is too large for 'long' type dup3.c:14: warning: integer constant is too large for 'long' type epoll_create.c: In function 'main': epoll_create.c:12: warning: integer constant is too large for 'long' type epoll_ctl.c: In function 'invoke_syscall': epoll_ctl.c:14: warning: integer constant is too large for 'long' type faccessat.c: In function 'main': faccessat.c:13: warning: integer constant is too large for 'long' type fchdir.c: In function 'main': fchdir.c:12: warning: integer constant is too large for 'long' type struct_flock.c: In function 'invoke_test_syscall': struct_flock.c:48: warning: integer constant is too large for 'long' type struct_flock.c: In function 'test_flock_einval': struct_flock.c:58: warning: integer constant is too large for 'long' type struct_flock.c:59: warning: integer constant is too large for 'long' type fcntl64.c: In function 'test_flock64_einval': fcntl64.c:44: warning: integer constant is too large for 'long' type fcntl64.c:45: warning: integer constant is too large for 'long' type fcntl.c: In function 'test_flock64_einval': fcntl.c:44: warning: integer constant is too large for 'long' type fcntl.c:45: warning: integer constant is too large for 'long' type fdatasync.c: In function 'main': fdatasync.c:12: warning: integer constant is too large for 'long' type flock.c: In function 'main': flock.c:13: warning: integer constant is too large for 'long' type xstatx.c: In function 'main': xstatx.c:255: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:290: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatx.c:294: warning: integer constant is too large for 'long' type xstatfsx.c: In function 'main': xstatfsx.c:113: warning: integer constant is too large for 'long' type fsync.c: In function 'main': fsync.c:12: warning: integer constant is too large for 'long' type ftruncate64.c: In function 'main': ftruncate64.c:39: warning: integer constant is too large for 'long' type futimesat.c: In function 'main': futimesat.c:52: warning: integer constant is too large for 'long' type futimesat.c:59: warning: integer constant is too large for 'long' type get_mempolicy.c: In function 'main': get_mempolicy.c:83: warning: integer constant is too large for 'long' type get_mempolicy.c:84: warning: integer constant is too large for 'long' type get_mempolicy.c:85: warning: integer constant is too large for 'long' type get_mempolicy.c:86: warning: integer constant is too large for 'long' type getdents.c: In function 'main': getdents.c:109: warning: integer constant is too large for 'long' type getdents.c:110: warning: integer constant is too large for 'long' type getdents.c:114: warning: integer constant is too large for 'long' type getdents64.c: In function 'main': getdents64.c:114: warning: integer constant is too large for 'long' type getdents64.c:115: warning: integer constant is too large for 'long' type getdents64.c:119: warning: integer constant is too large for 'long' type xgetrlimit.c: In function 'main': xgetrlimit.c:71: warning: integer constant is too large for 'long' type ioctl_block.c:44: warning: integer constant is too large for 'long' type ioctl_block.c: In function 'main': ioctl_block.c:136: warning: integer constant is too large for 'long' type ioctl_block.c:137: warning: integer constant is too large for 'long' type ioctl_block.c:161: warning: integer constant is too large for 'long' type ioctl_block.c:170: warning: integer constant is too large for 'long' type ioctl_block.c:171: warning: integer constant is too large for 'long' type ioctl_evdev.c:42: warning: integer constant is too large for 'long' type ioctl_mtd.c:46: warning: integer constant is too large for 'long' type ioctl_rtc.c:40: warning: integer constant is too large for 'long' type ioperm.c: In function 'main': ioperm.c:12: warning: integer constant is too large for 'long' type ioctl_v4l2.c: In function 'main': ioctl_v4l2.c:409: warning: integer constant is too large for 'long' type ipc.c: In function 'ipc_call': ipc.c:52: warning: integer constant is too large for 'long' type kill.c: In function 'main': kill.c:59: warning: integer constant is too large for 'long' type kill.c:62: warning: integer constant is too large for 'long' type kill.c:63: warning: integer constant is too large for 'long' type kill.c:68: warning: integer constant is too large for 'long' type linkat.c: In function 'main': linkat.c:14: warning: integer constant is too large for 'long' type linkat.c:15: warning: integer constant is too large for 'long' type mbind.c: In function 'main': mbind.c:41: warning: integer constant is too large for 'long' type mbind.c:43: warning: integer constant is too large for 'long' type mbind.c:44: warning: integer constant is too large for 'long' type migrate_pages.c: In function 'main': migrate_pages.c:41: warning: integer constant is too large for 'long' type In file included from mkdirat.c:10: umode_t.c: In function 'test_syscall': umode_t.c:47: warning: integer constant is too large for 'long' type mknod.c: In function 'call_mknod': mknod.c:16: warning: integer constant is too large for 'long' type mknod.c: In function 'main': mknod.c:23: warning: integer constant is too large for 'long' type mknod.c:49: warning: integer constant is too large for 'long' type mknod.c:56: warning: integer constant is too large for 'long' type mknodat.c:12: warning: integer constant is too large for 'long' type mknodat.c: In function 'call_mknodat': mknodat.c:17: warning: integer constant is too large for 'long' type mknodat.c: In function 'main': mknodat.c:24: warning: integer constant is too large for 'long' type mknodat.c:50: warning: integer constant is too large for 'long' type mknodat.c:57: warning: integer constant is too large for 'long' type mmap.c: In function 'main': mmap.c:51: warning: integer constant is too large for 'long' type move_pages.c: In function 'print_stat_pages': move_pages.c:139: warning: integer constant is too large for 'long' type move_pages.c: In function 'print_move_pages': move_pages.c:166: warning: integer constant is too large for 'long' type move_pages.c: In function 'main': move_pages.c:188: warning: integer constant is too large for 'long' type mq_sendrecv.c: In function 'main': mq_sendrecv.c:238: warning: integer constant is too large for 'long' type mq_sendrecv.c:401: warning: integer constant is too large for 'long' type mq_sendrecv.c:403: warning: integer constant is too large for 'long' type nsyscalls.c: In function 'test_syscall': nsyscalls.c:64: warning: integer constant is too large for 'long' type nsyscalls.c:65: warning: integer constant is too large for 'long' type nsyscalls.c:66: warning: integer constant is too large for 'long' type nsyscalls.c:67: warning: integer constant is too large for 'long' type nsyscalls.c:68: warning: integer constant is too large for 'long' type nsyscalls.c:69: warning: integer constant is too large for 'long' type preadv-pwritev.c: In function 'main': preadv-pwritev.c:162: warning: comparison between signed and unsigned prlimit64.c: In function 'main': prlimit64.c:65: warning: integer constant is too large for 'long' type prlimit64.c:70: warning: integer constant is too large for 'long' type remap_file_pages.c: In function 'main': remap_file_pages.c:42: warning: integer constant is too large for 'long' type remap_file_pages.c:43: warning: integer constant is too large for 'long' type remap_file_pages.c:45: warning: integer constant is too large for 'long' type renameat.c: In function 'main': renameat.c:15: warning: integer constant is too large for 'long' type renameat.c:16: warning: integer constant is too large for 'long' type rt_sigqueueinfo.c: In function 'main': rt_sigqueueinfo.c:41: warning: integer constant is too large for 'long' type rt_tgsigqueueinfo.c: In function 'k_tgsigqueueinfo': rt_tgsigqueueinfo.c:45: warning: integer constant is too large for 'long' type rt_tgsigqueueinfo.c:46: warning: integer constant is too large for 'long' type rt_tgsigqueueinfo.c:47: warning: integer constant is too large for 'long' type rt_tgsigqueueinfo.c: In function 'main': rt_tgsigqueueinfo.c:67: warning: integer constant is too large for 'long' type sendfile.c: In function 'main': sendfile.c:110: warning: integer constant is too large for 'long' type sendfile64.c: In function 'main': sendfile64.c:100: warning: integer constant is too large for 'long' type set_mempolicy.c: In function 'main': set_mempolicy.c:129: warning: integer constant is too large for 'long' type set_mempolicy.c:130: warning: integer constant is too large for 'long' type setrlimit.c: In function 'main': setrlimit.c:44: warning: integer constant is too large for 'long' type socketcall.c: In function 'test_socketcall': socketcall.c:58: warning: integer constant is too large for 'long' type splice.c: In function 'main': splice.c:41: warning: integer constant is too large for 'long' type splice.c:42: warning: integer constant is too large for 'long' type splice.c:45: warning: integer constant is too large for 'long' type splice.c:46: warning: integer constant is too large for 'long' type symlinkat.c: In function 'main': symlinkat.c:12: warning: integer constant is too large for 'long' type sync_file_range.c: In function 'main': sync_file_range.c:42: warning: integer constant is too large for 'long' type sync_file_range.c:43: warning: integer constant is too large for 'long' type syslog.c: In function 'main': syslog.c:14: warning: integer constant is too large for 'long' type tee.c: In function 'main': tee.c:41: warning: integer constant is too large for 'long' type tee.c:42: warning: integer constant is too large for 'long' type timer_create.c: In function 'main': timer_create.c:52: warning: integer constant is too large for 'long' type timer_create.c:84: warning: integer constant is too large for 'long' type timer_create.c:85: warning: integer constant is too large for 'long' type truncate64.c: In function 'main': truncate64.c:41: warning: integer constant is too large for 'long' type xgetrlimit.c: In function 'main': xgetrlimit.c:71: warning: integer constant is too large for 'long' type umode_t.c: In function 'test_syscall': umode_t.c:46: warning: integer constant is too large for 'long' type unlinkat.c: In function 'main': unlinkat.c:13: warning: integer constant is too large for 'long' type waitpid.c: In function 'main': waitpid.c:43: warning: integer constant is too large for 'long' type waitid.c: In function 'poison': waitid.c:141: warning: integer constant is too large for 'long' type xetpriority.c: In function 'main': xetpriority.c:15: warning: integer constant is too large for 'long' type xetpriority.c:19: warning: integer constant is too large for 'long' type xetpriority.c:20: warning: integer constant is too large for 'long' type xetpgid.c: In function 'main': xetpgid.c:43: warning: integer constant is too large for 'long' type xetpgid.c:47: warning: integer constant is too large for 'long' type xetpgid.c:48: warning: integer constant is too large for 'long' type (SLES 11SP4, i386) * tests/alarm.c (main): Add proper suffix to integer constant. * tests/aio.c (main): Likewise. * tests/btrfs.c (btrfs_test_sync_ioctls, btrfs_test_subvol_ioctls): Likewise. * tests/dup2.c (main): Likewise. * tests/dup3.c (main): Likewise. * tests/epoll_create.c (main): Likewise. * tests/epoll_ctl.c (invoke_syscall): Likewise. * tests/faccessat.c (main): Likewise. * tests/fchdir.c (main): Likewise. * tests/fcntl.c (test_flock64_einval): Likewise. * tests/fcntl64.c (test_flock64_einval): Likewise. * tests/fdatasync.c (main): Likewise. * tests/flock.c (main): Likewise. * tests/fstat64.c (SAMPLE_SIZE): Likewise. * tests/fstat.c (SAMPLE_SIZE): Likewise. * tests/fsync.c (main): Likewise. * tests/ftruncate64.c (main): Likewise. * tests/futimesat.c (main): Likewise. * tests/get_mempolicy.c (main): Likewise. * tests/getdents.c (main): Likewise. * tests/getdents64.c (main): Likewise. * tests/ioctl_block.c (lmagic, main): Likewise. * tests/ioctl_evdev.c (lmagic): Likewise. * tests/ioctl_mtd.c (lmagic): Likewise. * tests/ioctl_rtc.c (lmagic): Likewise. * tests/ioctl_v4l2.c (main): Likewise. * tests/ioperm.c (main): Likewise. * tests/ipc.c (ipc_call): Likewise. * tests/kill.c (main): Likewise. * tests/linkat.c (main): Likewise. * tests/lstat64.c (SAMPLE_SIZE): Likewise. * tests/lstat.c (SAMPLE_SIZE): Likewise. * tests/mbind.c (main): Likewise. * tests/migrate_pages.c (main): Likewise. * tests/mkdirat.c (TEST_SYSCALL_PREFIX_ARGS): Likewise. * tests/mknod.c (call_mknod, main): Likewise. * tests/mknodat.c (fd, call_mknodat, main): Likewise. * tests/mmap.c (main): Likewise. * tests/move_pages.c (print_stat_pages, print_move_pages): Likewise. * tests/mq_sendrecv.c (main): Likewise. * tests/nsyscalls.c (test_syscall): Likewise. * tests/prlimit64.c (main): Likewise. * tests/remap_file_pages.c (main): Likewise. * tests/renameat.c (main): Likewise. * tests/rt_sigqueueinfo.c (main): Likewise. * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo, main): Likewise. * tests/sendfile.c (main): Likewise. * tests/sendfile64.c (main): Likewise. * tests/set_mempolicy.c (main): Likewise. * tests/setrlimit.c (main): Likewise. * tests/socketcall.c (test_socketcall): Likewise. * tests/splice.c (main): Likewise. * tests/stat64.c (SAMPLE_SIZE): Likewise. * tests/stat.c (SAMPLE_SIZE): Likewise. * tests/struct_flock.c (invoke_test_syscall, test_flock_einval): Likewise. * tests/symlinkat.c (main): Likewise. * tests/sync_file_range.c (main): Likewise. * tests/syslog.c (main): Likewise. * tests/tee.c (main): Likewise. * tests/timer_create.c (main): Likewise. * tests/truncate64.c (main): Likewise. * tests/umode_t.c (test_syscall): Likewise. * tests/unlinkat.c (main): Likewise. * tests/waitid.c (main): Likewise. * tests/waitpid.c (main): Likewise. * tests/xetpgid.c (main): Likewise. * tests/xetpriority.c (main): Likewise. * tests/xgetrlimit.c (main): Likewise. * tests/xstatfsx.c (main) [CHECK_ODD_SIZE]: Likewise. * tests/xstatx.c (main): Likewise. --- diff --git a/tests/aio.c b/tests/aio.c index 8717f4fa..7c5afac2 100644 --- a/tests/aio.c +++ b/tests/aio.c @@ -159,7 +159,7 @@ main(void) .aio_fildes = 0xdefaced1, .aio_buf = (unsigned long)data2, .aio_nbytes = sizeof(data2), - .aio_offset = 0xdeadda7abadc0ded, + .aio_offset = 0xdeadda7abadc0dedULL, }, { .aio_data = 0, diff --git a/tests/alarm.c b/tests/alarm.c index f954dcf3..291b26ad 100644 --- a/tests/alarm.c +++ b/tests/alarm.c @@ -38,7 +38,7 @@ int main(void) { - int rc = syscall(__NR_alarm, (unsigned long) 0xffffffff0000002a); + int rc = syscall(__NR_alarm, (unsigned long) 0xffffffff0000002aULL); printf("alarm(%u) = %d\n", 42, rc); puts("+++ exited with 0 +++"); diff --git a/tests/btrfs.c b/tests/btrfs.c index d6005347..85541a1d 100644 --- a/tests/btrfs.c +++ b/tests/btrfs.c @@ -199,7 +199,7 @@ btrfs_test_trans_ioctls(void) static void btrfs_test_sync_ioctls(void) { - uint64_t u64val = 0xdeadbeefbadc0ded; + uint64_t u64val = 0xdeadbeefbadc0dedULL; ioctl(-1, BTRFS_IOC_SYNC, NULL); printf("ioctl(-1, BTRFS_IOC_SYNC) = -1 EBADF (%m)\n"); @@ -286,8 +286,8 @@ btrfs_test_subvol_ioctls(void) { const char *subvol_name = "subvol-name"; char *long_subvol_name; - void *bad_pointer = (void *) (unsigned long) 0xdeadbeeffffffeed; - uint64_t u64val = 0xdeadbeefbadc0ded; + void *bad_pointer = (void *) (unsigned long) 0xdeadbeeffffffeedULL; + uint64_t u64val = 0xdeadbeefbadc0dedULL; struct btrfs_ioctl_vol_args vol_args = {}; struct btrfs_ioctl_vol_args_v2 vol_args_v2 = { .fd = 2, diff --git a/tests/dup2.c b/tests/dup2.c index 04a261c4..9f3addfa 100644 --- a/tests/dup2.c +++ b/tests/dup2.c @@ -9,8 +9,8 @@ int main(void) { - const long int fd_old = (long int) 0xdeadbeefffffffff; - const long int fd_new = (long int) 0xdeadbeeffffffffe; + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; long rc = syscall(__NR_dup2, fd_old, fd_new); printf("dup2(%d, %d) = %ld %s (%m)\n", diff --git a/tests/dup3.c b/tests/dup3.c index 2611dd8c..252e8469 100644 --- a/tests/dup3.c +++ b/tests/dup3.c @@ -10,8 +10,8 @@ int main(void) { - const long int fd_old = (long int) 0xdeadbeefffffffff; - const long int fd_new = (long int) 0xdeadbeeffffffffe; + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; long rc = syscall(__NR_dup3, fd_old, fd_new, O_CLOEXEC); printf("dup3(%d, %d, O_CLOEXEC) = %ld %s (%m)\n", diff --git a/tests/epoll_create.c b/tests/epoll_create.c index 1f248523..44262c7d 100644 --- a/tests/epoll_create.c +++ b/tests/epoll_create.c @@ -9,7 +9,7 @@ int main(void) { - const long int size = (long int) 0xdeadbeefffffffff; + const long int size = (long int) 0xdeadbeefffffffffULL; long rc = syscall(__NR_epoll_create, size); printf("epoll_create(%d) = %ld %s (%m)\n", diff --git a/tests/epoll_ctl.c b/tests/epoll_ctl.c index 8b46f4e3..e6660555 100644 --- a/tests/epoll_ctl.c +++ b/tests/epoll_ctl.c @@ -11,7 +11,7 @@ static long invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev) { - op |= (unsigned long) 0xffffffff00000000; + op |= (unsigned long) 0xffffffff00000000ULL; return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev); } diff --git a/tests/faccessat.c b/tests/faccessat.c index c21039d6..ce81349d 100644 --- a/tests/faccessat.c +++ b/tests/faccessat.c @@ -10,7 +10,7 @@ int main(void) { static const char sample[] = "faccessat.sample"; - const long int fd = (long int) 0xdeadbeefffffffff; + const long int fd = (long int) 0xdeadbeefffffffffULL; long rc = syscall(__NR_faccessat, fd, sample, F_OK); printf("faccessat(%d, \"%s\", F_OK) = %ld %s (%m)\n", diff --git a/tests/fchdir.c b/tests/fchdir.c index 58088721..3cde5e63 100644 --- a/tests/fchdir.c +++ b/tests/fchdir.c @@ -9,7 +9,7 @@ int main(void) { - const long int fd = (long int) 0xdeadbeefffffffff; + const long int fd = (long int) 0xdeadbeefffffffffULL; long rc = syscall(__NR_fchdir, fd); printf("fchdir(%d) = %ld %s (%m)\n", diff --git a/tests/fcntl.c b/tests/fcntl.c index 4ae5beb7..f060cdf8 100644 --- a/tests/fcntl.c +++ b/tests/fcntl.c @@ -41,8 +41,8 @@ test_flock64_einval(const int cmd, const char *name) { struct_kernel_flock64 fl = { .l_type = F_RDLCK, - .l_start = 0xdefaced1facefeed, - .l_len = 0xdefaced2cafef00d + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL }; invoke_test_syscall(cmd, &fl); printf("%s(0, %s, %p) = %s\n", diff --git a/tests/fcntl64.c b/tests/fcntl64.c index ff6a5315..5ecd6eb9 100644 --- a/tests/fcntl64.c +++ b/tests/fcntl64.c @@ -41,8 +41,8 @@ test_flock64_einval(const int cmd, const char *name) { struct_kernel_flock64 fl = { .l_type = F_RDLCK, - .l_start = 0xdefaced1facefeed, - .l_len = 0xdefaced2cafef00d + .l_start = 0xdefaced1facefeedULL, + .l_len = 0xdefaced2cafef00dULL }; invoke_test_syscall(cmd, &fl); printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" diff --git a/tests/fdatasync.c b/tests/fdatasync.c index c47a0bfb..fc82ade3 100644 --- a/tests/fdatasync.c +++ b/tests/fdatasync.c @@ -9,7 +9,7 @@ int main(void) { - const long int fd = (long int) 0xdeadbeefffffffff; + const long int fd = (long int) 0xdeadbeefffffffffULL; long rc = syscall(__NR_fdatasync, fd); printf("fdatasync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); diff --git a/tests/flock.c b/tests/flock.c index cb231d53..c154e437 100644 --- a/tests/flock.c +++ b/tests/flock.c @@ -10,7 +10,7 @@ int main(void) { - const unsigned long fd = (long int) 0xdeadbeefffffffff; + const unsigned long fd = (long int) 0xdeadbeefffffffffULL; long rc = syscall(__NR_flock, fd, LOCK_SH); printf("flock(%d, LOCK_SH) = %ld %s (%m)\n", diff --git a/tests/fstat.c b/tests/fstat.c index 9ddc8118..8a6c8531 100644 --- a/tests/fstat.c +++ b/tests/fstat.c @@ -32,7 +32,7 @@ # define TEST_SYSCALL_NR __NR_fstat # define TEST_SYSCALL_STR "fstat" -# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418) +# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418ULL) # include "fstatx.c" #else diff --git a/tests/fstat64.c b/tests/fstat64.c index cf147df3..8997c4f2 100644 --- a/tests/fstat64.c +++ b/tests/fstat64.c @@ -35,7 +35,7 @@ # define STRUCT_STAT struct stat64 # define STRUCT_STAT_STR "struct stat64" # define STRUCT_STAT_IS_STAT64 1 -# define SAMPLE_SIZE ((libc_off_t) 43147718418) +# define SAMPLE_SIZE ((libc_off_t) 43147718418ULL) # include "fstatx.c" #else diff --git a/tests/fsync.c b/tests/fsync.c index 42aa5c73..2f504106 100644 --- a/tests/fsync.c +++ b/tests/fsync.c @@ -9,7 +9,7 @@ int main(void) { - const long int fd = (long int) 0xdeadbeefffffffff; + const long int fd = (long int) 0xdeadbeefffffffffULL; long rc = syscall(__NR_fsync, fd); printf("fsync(%d) = %ld %s (%m)\n", (int) fd, rc, errno2name()); diff --git a/tests/ftruncate64.c b/tests/ftruncate64.c index 7530e707..90d9938f 100644 --- a/tests/ftruncate64.c +++ b/tests/ftruncate64.c @@ -36,7 +36,7 @@ int main(void) { - const off_t len = 0xdefaceddeadbeef; + const off_t len = 0xdefaceddeadbeefULL; int rc = ftruncate(-1, len); printf("ftruncate64(-1, %llu) = %d %s (%m)\n", diff --git a/tests/futimesat.c b/tests/futimesat.c index 4e76cc8a..b56911c4 100644 --- a/tests/futimesat.c +++ b/tests/futimesat.c @@ -49,14 +49,14 @@ main(void) perror_msg_and_fail("gettimeofday"); static const char sample[] = "futimesat_sample"; - unsigned long dirfd = (unsigned long) 0xdeadbeef00000000 | -100U; + unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U; long rc = syscall(__NR_futimesat, dirfd, sample, 0); printf("futimesat(AT_FDCWD, \"%s\", NULL) = %ld %s (%m)\n", sample, rc, errno2name()); struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); - dirfd = (unsigned long) 0xdeadbeefffffffff; + dirfd = (unsigned long) 0xdeadbeefffffffffULL; rc = syscall(__NR_futimesat, dirfd, 0, ts + 1); printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n", diff --git a/tests/get_mempolicy.c b/tests/get_mempolicy.c index 6be3ef29..03d1bffc 100644 --- a/tests/get_mempolicy.c +++ b/tests/get_mempolicy.c @@ -81,9 +81,9 @@ main(void) puts("get_mempolicy(NULL, NULL, 0, NULL, 0) = 0"); int *mode = (void *) 0xdefaced1baddeed2; - unsigned long maxnode = (unsigned long) 0xcafef00dbadc0ded; - const unsigned long *nodemask = (void *) 0xfacedad3bebefed4; - const unsigned long addr = (unsigned long) 0xfacefeeddeadbeef; + unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; + const unsigned long *nodemask = (void *) 0xfacedad3bebefed4ULL; + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; const unsigned long flags = -1U; rc = syscall(__NR_get_mempolicy, mode, nodemask, maxnode, addr, flags); printf("get_mempolicy(%p, %p, %lu, %#lx, %s|%#lx) = %ld %s (%m)\n", diff --git a/tests/getdents.c b/tests/getdents.c index 5e642340..4c8455f8 100644 --- a/tests/getdents.c +++ b/tests/getdents.c @@ -106,12 +106,13 @@ main(int ac, const char **av) assert(!close(0)); assert(!open(".", O_RDONLY | O_DIRECTORY)); - unsigned long count = (unsigned long) 0xfacefeeddeadbeef; - long rc = syscall(__NR_getdents, (long) 0xdefacedffffffff, NULL, count); + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents, (long) 0xdefacedffffffffULL, NULL, + count); printf("getdents(-1, NULL, %u) = %ld %s (%m)\n", (unsigned) count, rc, errno2name()); - count = (unsigned long) 0xfacefeed00000000 | sizeof(buf); + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); while ((rc = syscall(__NR_getdents, 0, buf, count))) { kernel_dirent *d; long i; diff --git a/tests/getdents64.c b/tests/getdents64.c index 2243b842..9da2a23c 100644 --- a/tests/getdents64.c +++ b/tests/getdents64.c @@ -111,12 +111,13 @@ main(int ac, const char **av) assert(!close(0)); assert(!open(".", O_RDONLY | O_DIRECTORY)); - unsigned long count = (unsigned long) 0xfacefeeddeadbeef; - long rc = syscall(__NR_getdents64, (long) 0xdefacedffffffff, NULL, count); + unsigned long count = (unsigned long) 0xfacefeeddeadbeefULL; + long rc = syscall(__NR_getdents64, (long) 0xdefacedffffffffULL, NULL, + count); printf("getdents64(-1, NULL, %u) = %ld %s (%m)\n", (unsigned) count, rc, errno2name()); - count = (unsigned long) 0xfacefeed00000000 | sizeof(buf); + count = (unsigned long) 0xfacefeed00000000ULL | sizeof(buf); while ((rc = syscall(__NR_getdents64, 0, buf, count))) { kernel_dirent64 *d; long i; diff --git a/tests/ioctl_block.c b/tests/ioctl_block.c index 07e7d34d..221a3f14 100644 --- a/tests/ioctl_block.c +++ b/tests/ioctl_block.c @@ -41,7 +41,7 @@ #include "xlat.h" static const unsigned int magic = 0xdeadbeef; -static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0ded; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; static void init_magic(void *addr, const unsigned int size) @@ -133,8 +133,8 @@ main(void) printf("ioctl(-1, BLKBSZSET, [%d]) = -1 EBADF (%m)\n", *val_int); uint64_t *pair_int64 = tail_alloc(sizeof(*pair_int64) * 2); - pair_int64[0] = 0xdeadbeefbadc0ded; - pair_int64[1] = 0xfacefeedcafef00d; + pair_int64[0] = 0xdeadbeefbadc0dedULL; + pair_int64[1] = 0xfacefeedcafef00dULL; #ifdef BLKDISCARD ioctl(-1, BLKDISCARD, pair_int64); @@ -158,7 +158,7 @@ main(void) blkpg->op = 3; blkpg->flags = 0xdeadbeef; blkpg->datalen = 0xbadc0ded; - blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeed; + blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeedULL; ioctl(-1, BLKPG, blkpg); printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" @@ -167,8 +167,8 @@ main(void) (unsigned long) blkpg->data); struct blkpg_partition *const bp = tail_alloc(sizeof(*bp)); - bp->start = 0xfac1fed2dad3bef4; - bp->length = 0xfac5fed6dad7bef8; + bp->start = 0xfac1fed2dad3bef4ULL; + bp->length = 0xfac5fed6dad7bef8ULL; bp->pno = magic; memset(bp->devname, 'A', sizeof(bp->devname)); memset(bp->volname, 'B', sizeof(bp->volname)); diff --git a/tests/ioctl_evdev.c b/tests/ioctl_evdev.c index 892075dc..aded93f0 100644 --- a/tests/ioctl_evdev.c +++ b/tests/ioctl_evdev.c @@ -39,7 +39,7 @@ # include static const unsigned int magic = 0xdeadbeef; -static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0ded; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; static void init_magic(void *addr, const unsigned int size) diff --git a/tests/ioctl_mtd.c b/tests/ioctl_mtd.c index b761da85..e28bcc9d 100644 --- a/tests/ioctl_mtd.c +++ b/tests/ioctl_mtd.c @@ -43,7 +43,7 @@ #endif static const unsigned int magic = 0xdeadbeef; -static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0ded; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; static void init_magic(void *addr, const unsigned int size) diff --git a/tests/ioctl_rtc.c b/tests/ioctl_rtc.c index ac967637..34264ce5 100644 --- a/tests/ioctl_rtc.c +++ b/tests/ioctl_rtc.c @@ -37,7 +37,7 @@ #include "xlat.h" static const unsigned int magic = 0xdeadbeef; -static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0ded; +static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; static void init_magic(void *addr, const unsigned int size) diff --git a/tests/ioctl_v4l2.c b/tests/ioctl_v4l2.c index 850783d5..dbf08286 100644 --- a/tests/ioctl_v4l2.c +++ b/tests/ioctl_v4l2.c @@ -406,7 +406,7 @@ main(void ) tail_alloc(sizeof(*p_ext_controls->controls) * p_ext_controls->count); p_ext_controls->controls[0].id = V4L2_CID_BRIGHTNESS; p_ext_controls->controls[0].size = 0; - p_ext_controls->controls[0].value64 = 0xfacefeeddeadbeef; + p_ext_controls->controls[0].value64 = 0xfacefeeddeadbeefULL; p_ext_controls->controls[1].id = V4L2_CID_CONTRAST; p_ext_controls->controls[1].size = 2; p_ext_controls->controls[1].string = diff --git a/tests/ioperm.c b/tests/ioperm.c index 12342f30..2f02b523 100644 --- a/tests/ioperm.c +++ b/tests/ioperm.c @@ -9,7 +9,7 @@ int main(void) { - const unsigned long port = (unsigned long) 0xdeafbeefffffffff; + const unsigned long port = (unsigned long) 0xdeafbeefffffffffULL; long rc = syscall(__NR_ioperm, port, 1, 0); printf("ioperm(%#lx, %#lx, %d) = %ld %s (%m)\n", diff --git a/tests/ipc.c b/tests/ipc.c index f5b9ef5f..c64d3716 100644 --- a/tests/ipc.c +++ b/tests/ipc.c @@ -49,7 +49,7 @@ ipc_call(const unsigned short version, const unsigned short call, long a1, long a2, long a3, long a4, long a5) { const unsigned long val = - (unsigned long) 0xfacefeed00000000 | + (unsigned long) 0xfacefeed00000000ULL | (unsigned int) version << 16 | call; diff --git a/tests/kill.c b/tests/kill.c index 0e07e1f5..cb884aa1 100644 --- a/tests/kill.c +++ b/tests/kill.c @@ -56,16 +56,16 @@ main(void) perror_msg_and_fail("sigprocmask"); const int pid = getpid(); - long rc = syscall(__NR_kill, pid, (long) 0xdefaced00000000 | SIGALRM); + long rc = syscall(__NR_kill, pid, (long) 0xdefaced00000000ULL | SIGALRM); printf("kill(%d, SIGALRM) = %ld\n", pid, rc); - const long big_pid = (long) 0xfacefeedbadc0ded; - const long big_sig = (long) 0xdeadbeefcafef00d; + const long big_pid = (long) 0xfacefeedbadc0dedULL; + const long big_sig = (long) 0xdeadbeefcafef00dULL; rc = syscall(__NR_kill, big_pid, big_sig); printf("kill(%d, %d) = %ld %s (%m)\n", (int) big_pid, (int) big_sig, rc, errno2name()); - rc = syscall(__NR_kill, (long) 0xdefaced00000000 | pid, 0); + rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0); printf("kill(%d, SIG_0) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); diff --git a/tests/linkat.c b/tests/linkat.c index 2c3b8baa..64b900ea 100644 --- a/tests/linkat.c +++ b/tests/linkat.c @@ -11,8 +11,8 @@ main(void) { static const char sample_1[] = "linkat_sample_old"; static const char sample_2[] = "linkat_sample_new"; - const long fd_old = (long) 0xdeadbeefffffffff; - const long fd_new = (long) 0xdeadbeeffffffffe; + const long fd_old = (long) 0xdeadbeefffffffffULL; + const long fd_new = (long) 0xdeadbeeffffffffeULL; long rc = syscall(__NR_linkat, fd_old, sample_1, fd_new, sample_2, 0); printf("linkat(%d, \"%s\", %d, \"%s\", 0) = %ld %s (%m)\n", diff --git a/tests/lstat.c b/tests/lstat.c index 76cb8a2f..34a0e1d8 100644 --- a/tests/lstat.c +++ b/tests/lstat.c @@ -32,7 +32,7 @@ # define TEST_SYSCALL_NR __NR_lstat # define TEST_SYSCALL_STR "lstat" -# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418) +# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418ULL) # include "lstatx.c" #else diff --git a/tests/lstat64.c b/tests/lstat64.c index 68ef638b..ffb2c029 100644 --- a/tests/lstat64.c +++ b/tests/lstat64.c @@ -35,7 +35,7 @@ # define STRUCT_STAT struct stat64 # define STRUCT_STAT_STR "struct stat64" # define STRUCT_STAT_IS_STAT64 1 -# define SAMPLE_SIZE ((libc_off_t) 43147718418) +# define SAMPLE_SIZE ((libc_off_t) 43147718418ULL) # include "lstatx.c" #else diff --git a/tests/mbind.c b/tests/mbind.c index 94d45539..b0544263 100644 --- a/tests/mbind.c +++ b/tests/mbind.c @@ -38,10 +38,10 @@ int main(void) { - const unsigned long len = (unsigned long) 0xcafef00dbadc0ded; + const unsigned long len = (unsigned long) 0xcafef00dbadc0dedULL; const unsigned long mode = 3; - const unsigned long nodemask = (unsigned long) 0xfacefeedfffffff1; - const unsigned long maxnode = (unsigned long) 0xdeadbeeffffffff2; + const unsigned long nodemask = (unsigned long) 0xfacefeedfffffff1ULL; + const unsigned long maxnode = (unsigned long) 0xdeadbeeffffffff2ULL; const unsigned long flags = -1UL; long rc = syscall(__NR_mbind, 0, len, mode, nodemask, maxnode, flags); diff --git a/tests/migrate_pages.c b/tests/migrate_pages.c index 9f71b52c..4c303e38 100644 --- a/tests/migrate_pages.c +++ b/tests/migrate_pages.c @@ -38,7 +38,7 @@ int main(void) { - const long pid = (long) 0xfacefeedffffffff; + const long pid = (long) 0xfacefeedffffffffULL; long rc = syscall(__NR_migrate_pages, pid, 0, 0, 0); printf("migrate_pages(%d, 0, NULL, NULL) = %ld %s (%m)\n", (int) pid, rc, errno2name()); diff --git a/tests/mkdirat.c b/tests/mkdirat.c index ce2e9c18..6bfe4a5f 100644 --- a/tests/mkdirat.c +++ b/tests/mkdirat.c @@ -5,7 +5,7 @@ # define TEST_SYSCALL_NR __NR_mkdirat # define TEST_SYSCALL_STR "mkdirat" -# define TEST_SYSCALL_PREFIX_ARGS (long int) 0xdeadbeefffffffff, +# define TEST_SYSCALL_PREFIX_ARGS (long int) 0xdeadbeefffffffffULL, # define TEST_SYSCALL_PREFIX_STR "-1, " # include "umode_t.c" diff --git a/tests/mknod.c b/tests/mknod.c index 2d428743..4cc1c5cb 100644 --- a/tests/mknod.c +++ b/tests/mknod.c @@ -13,14 +13,14 @@ static const char sample[] = "mknod"; static long call_mknod(unsigned short mode, unsigned long dev) { - unsigned long lmode = (unsigned long) 0xffffffffffff0000 | mode; + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; return syscall(__NR_mknod, sample, lmode, dev); } int main(void) { - unsigned long dev = (unsigned long) 0xdeadbeefbadc0ded; + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; long rc = call_mknod(0, dev); printf("mknod(\"%s\", 000) = %ld %s (%m)\n", @@ -46,14 +46,14 @@ main(void) printf("mknod(\"%s\", S_IFIFO|0600) = %ld %s (%m)\n", sample, rc, errno2name()); - dev = (unsigned long) 0xdeadbeef00000000 | makedev(1, 7); + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknod(S_IFCHR | 024, dev); printf("mknod(\"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; - dev = (unsigned long) 0xdeadbeefbadc0ded; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; rc = call_mknod(mode, dev); printf("mknod(\"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" diff --git a/tests/mknodat.c b/tests/mknodat.c index 614513e8..756e2771 100644 --- a/tests/mknodat.c +++ b/tests/mknodat.c @@ -9,19 +9,19 @@ # include static const char sample[] = "mknodat_sample"; -static const long int fd = (long int) 0xdeadbeefffffffff; +static const long int fd = (long int) 0xdeadbeefffffffffULL; static long call_mknodat(unsigned short mode, unsigned long dev) { - unsigned long lmode = (unsigned long) 0xffffffffffff0000 | mode; + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; return syscall(__NR_mknodat, fd, sample, lmode, dev); } int main(void) { - unsigned long dev = (unsigned long) 0xdeadbeefbadc0ded; + unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; long rc = call_mknodat(0, dev); printf("mknodat(-1, \"%s\", 000) = %ld %s (%m)\n", @@ -47,14 +47,14 @@ main(void) printf("mknodat(-1, \"%s\", S_IFIFO|0600) = %ld %s (%m)\n", sample, rc, errno2name()); - dev = (unsigned long) 0xdeadbeef00000000 | makedev(1, 7); + dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknodat(S_IFCHR | 024, dev); printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; - dev = (unsigned long) 0xdeadbeefbadc0ded; + dev = (unsigned long) 0xdeadbeefbadc0dedULL; rc = call_mknodat(mode, dev); printf("mknodat(-1, \"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" diff --git a/tests/mmap.c b/tests/mmap.c index e2ff7163..f726f63e 100644 --- a/tests/mmap.c +++ b/tests/mmap.c @@ -45,10 +45,10 @@ main(int ac, char **av) void *addr, *p; #if ULONG_MAX > 4294967295UL - offset = 0xcafedeadbeef000 & -pagesize; + offset = 0xcafedeadbeef000ULL & -pagesize; addr = (void *) (uintmax_t) (0xfacefeed000 & -pagesize); #else - offset = 0xdeadbeef000 & -pagesize; + offset = 0xdeadbeef000ULL & -pagesize; addr = (void *) (unsigned int) (0xfaced000 & -pagesize); #endif const uintmax_t uoffset = diff --git a/tests/move_pages.c b/tests/move_pages.c index 3be7446a..f4ccafa2 100644 --- a/tests/move_pages.c +++ b/tests/move_pages.c @@ -136,7 +136,7 @@ static void print_stat_pages(const unsigned long pid, const unsigned long count, const void **const pages, int *const status) { - const unsigned long flags = (unsigned long) 0xfacefeed00000002; + const unsigned long flags = (unsigned long) 0xfacefeed00000002ULL; long rc = syscall(__NR_move_pages, pid, count, pages, NULL, status, flags); @@ -163,7 +163,7 @@ print_move_pages(const unsigned long pid, int *const nodes, int *const status) { - const unsigned long flags = (unsigned long) 0xfacefeed00000004; + const unsigned long flags = (unsigned long) 0xfacefeed00000004ULL; count += offset; long rc = syscall(__NR_move_pages, @@ -185,7 +185,7 @@ int main(void) { const unsigned long pid = - (unsigned long) 0xfacefeed00000000 | getpid(); + (unsigned long) 0xfacefeed00000000ULL | getpid(); unsigned long count = 1; const unsigned page_size = get_page_size(); const void *const page = tail_alloc(page_size); diff --git a/tests/mq_sendrecv.c b/tests/mq_sendrecv.c index de6464b3..97bf9f2b 100644 --- a/tests/mq_sendrecv.c +++ b/tests/mq_sendrecv.c @@ -235,7 +235,7 @@ main(void) struct_sigevent bogus_sev_data = { .sigev_notify = 0xdefaced, .sigev_signo = 0xfacefeed, - .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0ded + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL }; const char *errstr; @@ -398,9 +398,9 @@ main(void) /* SIGEV_THREAD */ bogus_sev->sigev_notify = SIGEV_THREAD; bogus_sev->sigev_un.sigev_thread.function = - (unsigned long) 0xdeadbeefbadc0ded; + (unsigned long) 0xdeadbeefbadc0dedULL; bogus_sev->sigev_un.sigev_thread.attribute = - (unsigned long) 0xcafef00dfacefeed; + (unsigned long) 0xcafef00dfacefeedULL; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); printf("mq_notify(%d, {sigev_value={int=%d, ptr=%#lx}, " "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " diff --git a/tests/nsyscalls.c b/tests/nsyscalls.c index 8e09acb9..68cb1481 100644 --- a/tests/nsyscalls.c +++ b/tests/nsyscalls.c @@ -61,12 +61,12 @@ static void test_syscall(const unsigned long nr) { static const kernel_ulong_t a[] = { - (kernel_ulong_t) 0xface0fedbadc0ded, - (kernel_ulong_t) 0xface1fedbadc1ded, - (kernel_ulong_t) 0xface2fedbadc2ded, - (kernel_ulong_t) 0xface3fedbadc3ded, - (kernel_ulong_t) 0xface4fedbadc4ded, - (kernel_ulong_t) 0xface5fedbadc5ded + (kernel_ulong_t) 0xface0fedbadc0dedULL, + (kernel_ulong_t) 0xface1fedbadc1dedULL, + (kernel_ulong_t) 0xface2fedbadc2dedULL, + (kernel_ulong_t) 0xface3fedbadc3dedULL, + (kernel_ulong_t) 0xface4fedbadc4dedULL, + (kernel_ulong_t) 0xface5fedbadc5dedULL }; long rc = syscall(nr | SYSCALL_BIT, diff --git a/tests/prlimit64.c b/tests/prlimit64.c index e62ea261..1e651161 100644 --- a/tests/prlimit64.c +++ b/tests/prlimit64.c @@ -62,12 +62,12 @@ int main(void) { unsigned long pid = - (unsigned long) 0xdefaced00000000 | (unsigned) getpid(); + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); uint64_t *const rlimit = tail_alloc(sizeof(*rlimit) * 2); const struct xlat *xlat; for (xlat = resources; xlat->str; ++xlat) { - unsigned long res = 0xfacefeed00000000 | xlat->val; + unsigned long res = 0xfacefeed00000000ULL | xlat->val; long rc = syscall(__NR_prlimit64, pid, res, 0, rlimit); if (rc) printf("prlimit64(%d, %s, NULL, %p) = %ld %s (%m)\n", diff --git a/tests/remap_file_pages.c b/tests/remap_file_pages.c index 9298f289..452d2de7 100644 --- a/tests/remap_file_pages.c +++ b/tests/remap_file_pages.c @@ -39,10 +39,10 @@ int main(void) { - const unsigned long addr = (unsigned long) 0xfacefeeddeadbeef; - const unsigned long size = (unsigned long) 0xdefaced1bad2f00d; + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; + const unsigned long size = (unsigned long) 0xdefaced1bad2f00dULL; const unsigned long prot = PROT_READ|PROT_WRITE|PROT_EXEC; - const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deed; + const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deedULL; const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS; long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags); diff --git a/tests/renameat.c b/tests/renameat.c index d2015789..2b874efa 100644 --- a/tests/renameat.c +++ b/tests/renameat.c @@ -12,8 +12,8 @@ int main(void) { - const long int fd_old = (long int) 0xdeadbeefffffffff; - const long int fd_new = (long int) 0xdeadbeeffffffffe; + const long int fd_old = (long int) 0xdeadbeefffffffffULL; + const long int fd_new = (long int) 0xdeadbeeffffffffeULL; long rc = syscall(__NR_renameat, fd_old, OLD_FILE, fd_new, NEW_FILE); printf("renameat(%d, \"%s\", %d, \"%s\") = %ld %s (%m)\n", diff --git a/tests/rt_sigqueueinfo.c b/tests/rt_sigqueueinfo.c index 9ca860ad..aba6776c 100644 --- a/tests/rt_sigqueueinfo.c +++ b/tests/rt_sigqueueinfo.c @@ -38,7 +38,7 @@ main (void) .sa_handler = SIG_IGN }; union sigval value = { - .sival_ptr = (void *) (unsigned long) 0xdeadbeefbadc0ded + .sival_ptr = (void *) (unsigned long) 0xdeadbeefbadc0dedULL }; pid_t pid = getpid(); diff --git a/tests/rt_tgsigqueueinfo.c b/tests/rt_tgsigqueueinfo.c index ebfb7196..d0500c32 100644 --- a/tests/rt_tgsigqueueinfo.c +++ b/tests/rt_tgsigqueueinfo.c @@ -42,9 +42,9 @@ static long k_tgsigqueueinfo(const pid_t pid, const int sig, const void const *info) { return syscall(__NR_rt_tgsigqueueinfo, - (unsigned long) 0xffffffff00000000 | pid, - (unsigned long) 0xffffffff00000000 | pid, - (unsigned long) 0xffffffff00000000 | sig, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL | sig, info); } @@ -64,7 +64,7 @@ main (void) info->si_code = SI_QUEUE; info->si_pid = getpid(); info->si_uid = getuid(); - info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeed; + info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL; if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info)) (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)( diff --git a/tests/sendfile.c b/tests/sendfile.c index 61f9212f..23f096b6 100644 --- a/tests/sendfile.c +++ b/tests/sendfile.c @@ -107,7 +107,7 @@ main(int ac, const char **av) if (p_off != p) { uint64_t *p_off64 = (uint64_t *) p_off; - *p_off64 = 0xcafef00dfacefeed; + *p_off64 = 0xcafef00dfacefeedULL; assert(syscall(__NR_sendfile, sv[1], reg_in, p_off64, 1) == -1); printf("sendfile(%d, %d, [14627392582579060461], 1)" " = -1 EINVAL (%m)\n", sv[1], reg_in); diff --git a/tests/sendfile64.c b/tests/sendfile64.c index f757963e..7208c300 100644 --- a/tests/sendfile64.c +++ b/tests/sendfile64.c @@ -97,7 +97,7 @@ main(int ac, const char **av) (unsigned long) stb.st_size + 1, (unsigned long) blen); - *p_off = 0xcafef00dfacefeed; + *p_off = 0xcafef00dfacefeedULL; assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1); printf("sendfile64(%d, %d, [14627392582579060461], 1)" " = -1 EINVAL (%m)\n", sv[1], reg_in); diff --git a/tests/set_mempolicy.c b/tests/set_mempolicy.c index 3802eafa..f3261a09 100644 --- a/tests/set_mempolicy.c +++ b/tests/set_mempolicy.c @@ -126,8 +126,8 @@ main(void) perror_msg_and_skip("set_mempolicy"); puts("set_mempolicy(MPOL_DEFAULT, NULL, 0) = 0"); - const unsigned long *nodemask = (void *) 0xfacefeedfffffffe; - const unsigned long maxnode = (unsigned long) 0xcafef00dbadc0ded; + const unsigned long *nodemask = (void *) 0xfacefeedfffffffeULL; + const unsigned long maxnode = (unsigned long) 0xcafef00dbadc0dedULL; long rc = syscall(__NR_set_mempolicy, 1, nodemask, maxnode); printf("set_mempolicy(MPOL_PREFERRED, %p, %lu) = %s\n", nodemask, maxnode, sprintrc(rc)); diff --git a/tests/setrlimit.c b/tests/setrlimit.c index 95dd8985..e93c8e37 100644 --- a/tests/setrlimit.c +++ b/tests/setrlimit.c @@ -41,7 +41,7 @@ main(void) const struct xlat *xlat; for (xlat = resources; xlat->str; ++xlat) { - unsigned long res = 0xfacefeed00000000 | xlat->val; + unsigned long res = 0xfacefeed00000000ULL | xlat->val; long rc = syscall(__NR_setrlimit, res, 0); printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); diff --git a/tests/socketcall.c b/tests/socketcall.c index d2ec959a..4fe1ea3a 100644 --- a/tests/socketcall.c +++ b/tests/socketcall.c @@ -55,7 +55,7 @@ static void test_socketcall(const int i, const void *const addr) { const unsigned long call = - (unsigned long) 0xfacefeed00000000 | (unsigned int) i; + (unsigned long) 0xfacefeed00000000ULL | (unsigned int) i; long rc = syscall(__NR_socketcall, call, addr); diff --git a/tests/splice.c b/tests/splice.c index 5a899109..b6f25256 100644 --- a/tests/splice.c +++ b/tests/splice.c @@ -38,12 +38,12 @@ int main(void) { - const long int fd_in = (long int) 0xdeadbeefffffffff; - const long int fd_out = (long int) 0xdeadbeeffffffffe; + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; long long int *const off_in = tail_alloc(sizeof(*off_in)); long long int *const off_out = tail_alloc(sizeof(*off_out)); - *off_in = 0xdeadbef1facefed1; - *off_out = 0xdeadbef2facefed2; + *off_in = 0xdeadbef1facefed1ULL; + *off_out = 0xdeadbef2facefed2ULL; const size_t len = (size_t) 0xdeadbef3facefed3ULL; const unsigned int flags = 15; diff --git a/tests/stat.c b/tests/stat.c index df6cab16..332a66fa 100644 --- a/tests/stat.c +++ b/tests/stat.c @@ -32,7 +32,7 @@ # define TEST_SYSCALL_NR __NR_stat # define TEST_SYSCALL_STR "stat" -# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418) +# define SAMPLE_SIZE ((kernel_ulong_t) 43147718418ULL) # include "lstatx.c" #else diff --git a/tests/stat64.c b/tests/stat64.c index 4c2101bb..dc9059de 100644 --- a/tests/stat64.c +++ b/tests/stat64.c @@ -35,7 +35,7 @@ # define STRUCT_STAT struct stat64 # define STRUCT_STAT_STR "struct stat64" # define STRUCT_STAT_IS_STAT64 1 -# define SAMPLE_SIZE ((libc_off_t) 43147718418) +# define SAMPLE_SIZE ((libc_off_t) 43147718418ULL) # include "lstatx.c" #else diff --git a/tests/struct_flock.c b/tests/struct_flock.c index aae71a03..34cf58e6 100644 --- a/tests/struct_flock.c +++ b/tests/struct_flock.c @@ -45,7 +45,7 @@ static long invoke_test_syscall(const unsigned int cmd, void *const p) { - const unsigned long op = (unsigned long) 0xffffffff00000000 | cmd; + const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd; return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p); } @@ -55,8 +55,8 @@ test_flock_einval(const int cmd, const char *name) { struct_kernel_flock fl = { .l_type = F_RDLCK, - .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeed, - .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00d + .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL, + .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL }; invoke_test_syscall(cmd, &fl); printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" diff --git a/tests/symlinkat.c b/tests/symlinkat.c index d0116d07..6e5d617d 100644 --- a/tests/symlinkat.c +++ b/tests/symlinkat.c @@ -9,7 +9,7 @@ int main(void) { - const long int fd = (long int) 0xdeadbeefffffffff; + const long int fd = (long int) 0xdeadbeefffffffffULL; static const char oldpath[] = "symlink_old"; static const char newpath[] = "symlink_new"; diff --git a/tests/sync_file_range.c b/tests/sync_file_range.c index aadef68c..67d31a89 100644 --- a/tests/sync_file_range.c +++ b/tests/sync_file_range.c @@ -39,8 +39,8 @@ int main(void) { const int fd = -1; - const off64_t offset = 0xdeadbeefbadc0ded; - const off64_t nbytes = 0xfacefeedcafef00d; + const off64_t offset = 0xdeadbeefbadc0dedULL; + const off64_t nbytes = 0xfacefeedcafef00dULL; const unsigned int flags = -1; int rc = sync_file_range(fd, offset, nbytes, flags); diff --git a/tests/syslog.c b/tests/syslog.c index d4d4a7bb..5df96cb8 100644 --- a/tests/syslog.c +++ b/tests/syslog.c @@ -11,7 +11,7 @@ int main(void) { - const long addr = (long) 0xfacefeeddeadbeef; + const long addr = (long) 0xfacefeeddeadbeefULL; int rc = syscall(__NR_syslog, SYSLOG_ACTION_READ, addr, -1); printf("syslog(SYSLOG_ACTION_READ, %#lx, -1) = %d %s (%m)\n", addr, rc, errno2name()); diff --git a/tests/tee.c b/tests/tee.c index eb562c7c..66d1c94f 100644 --- a/tests/tee.c +++ b/tests/tee.c @@ -38,8 +38,8 @@ int main(void) { - const long int fd_in = (long int) 0xdeadbeefffffffff; - const long int fd_out = (long int) 0xdeadbeeffffffffe; + const long int fd_in = (long int) 0xdeadbeefffffffffULL; + const long int fd_out = (long int) 0xdeadbeeffffffffeULL; const size_t len = (size_t) 0xdeadbef3facefed3ULL; const unsigned int flags = 15; diff --git a/tests/timer_create.c b/tests/timer_create.c index 6f98f368..f13b7b04 100644 --- a/tests/timer_create.c +++ b/tests/timer_create.c @@ -49,7 +49,7 @@ main(void) struct_sigevent sev = { .sigev_notify = 0xdefaced, .sigev_signo = 0xfacefeed, - .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0ded + .sigev_value.sival_ptr = (unsigned long) 0xdeadbeefbadc0dedULL }; syscall(__NR_timer_create, CLOCK_REALTIME, &sev, NULL); @@ -81,8 +81,10 @@ main(void) sev.sigev_value.sival_ptr, tid[1]); sev.sigev_notify = SIGEV_THREAD; - sev.sigev_un.sigev_thread.function = (unsigned long) 0xdeadbeefbadc0ded; - sev.sigev_un.sigev_thread.attribute = (unsigned long) 0xcafef00dfacefeed; + sev.sigev_un.sigev_thread.function = + (unsigned long) 0xdeadbeefbadc0dedULL; + sev.sigev_un.sigev_thread.attribute = + (unsigned long) 0xcafef00dfacefeedULL; if (syscall(__NR_timer_create, CLOCK_REALTIME, &sev, &tid[2])) perror_msg_and_skip("timer_create CLOCK_REALTIME"); printf("timer_create(CLOCK_REALTIME, {sigev_value={int=%d, ptr=%#lx}" diff --git a/tests/truncate64.c b/tests/truncate64.c index c4a524d5..8c29ea81 100644 --- a/tests/truncate64.c +++ b/tests/truncate64.c @@ -38,7 +38,7 @@ main(void) { static const char fname[] = "truncate64\nfilename"; static const char qname[] = "truncate64\\nfilename"; - const off_t len = 0xdefaceddeadbeef; + const off_t len = 0xdefaceddeadbeefULL; int rc = truncate(fname, len); printf("truncate64(\"%s\", %llu) = %d %s (%m)\n", diff --git a/tests/umode_t.c b/tests/umode_t.c index 7ab27dc0..5041638e 100644 --- a/tests/umode_t.c +++ b/tests/umode_t.c @@ -43,7 +43,7 @@ static const char sample[] = TEST_SYSCALL_STR; static void test_syscall(unsigned short mode) { - unsigned long lmode = (unsigned long) 0xffffffffffff0000 | mode; + unsigned long lmode = (unsigned long) 0xffffffffffff0000ULL | mode; long rc = syscall(TEST_SYSCALL_NR, TEST_SYSCALL_PREFIX_ARGS sample, lmode); diff --git a/tests/unlinkat.c b/tests/unlinkat.c index 0b69b037..22c3de39 100644 --- a/tests/unlinkat.c +++ b/tests/unlinkat.c @@ -10,7 +10,7 @@ int main(void) { static const char sample[] = "unlinkat_sample"; - const long fd = (long) 0xdeadbeefffffffff; + const long fd = (long) 0xdeadbeefffffffffULL; long rc = syscall(__NR_unlinkat, fd, sample, 0); printf("unlinkat(%d, \"%s\", 0) = %ld %s (%m)\n", diff --git a/tests/waitid.c b/tests/waitid.c index b379f1a1..c7fc507b 100644 --- a/tests/waitid.c +++ b/tests/waitid.c @@ -138,7 +138,7 @@ sprint_siginfo(const siginfo_t *const si, const char *const status_text) static unsigned long poison(unsigned int v) { - return (unsigned long) 0xfacefeed00000000 | v; + return (unsigned long) 0xfacefeed00000000ULL | v; } static long diff --git a/tests/waitpid.c b/tests/waitpid.c index dbcdf873..2e22e245 100644 --- a/tests/waitpid.c +++ b/tests/waitpid.c @@ -40,7 +40,7 @@ int main(void) { unsigned long pid = - (unsigned long) 0xdefaced00000000 | (unsigned) getpid(); + (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); long rc = syscall(__NR_waitpid, pid, 0L, (unsigned long) WNOHANG); printf("waitpid(%d, NULL, WNOHANG) = %ld %s (%m)\n", (int) pid, rc, errno2name()); diff --git a/tests/xetpgid.c b/tests/xetpgid.c index d4d5545c..24e0d7f0 100644 --- a/tests/xetpgid.c +++ b/tests/xetpgid.c @@ -40,12 +40,12 @@ main(void) { const int pid = getpid(); long rc = syscall(__NR_getpgid, - (unsigned long) 0xffffffff00000000 | pid); + (unsigned long) 0xffffffff00000000ULL | pid); printf("getpgid(%d) = %ld\n", pid, rc); rc = syscall(__NR_setpgid, - (unsigned long) 0xffffffff00000000, - (unsigned long) 0xffffffff00000000 | pid); + (unsigned long) 0xffffffff00000000ULL, + (unsigned long) 0xffffffff00000000ULL | pid); printf("setpgid(0, %d) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); diff --git a/tests/xetpriority.c b/tests/xetpriority.c index dfd32642..ed552598 100644 --- a/tests/xetpriority.c +++ b/tests/xetpriority.c @@ -12,12 +12,12 @@ main(void) { const int pid = getpid(); long rc = syscall(__NR_getpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000 | pid); + (unsigned long) 0xffffffff00000000ULL | pid); printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc); rc = syscall(__NR_setpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000 | pid, - (unsigned long) 0xffffffff00000000); + (unsigned long) 0xffffffff00000000ULL | pid, + (unsigned long) 0xffffffff00000000ULL); printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc)); puts("+++ exited with 0 +++"); diff --git a/tests/xgetrlimit.c b/tests/xgetrlimit.c index d787ce38..54ced9a7 100644 --- a/tests/xgetrlimit.c +++ b/tests/xgetrlimit.c @@ -68,7 +68,7 @@ main(void) const struct xlat *xlat; for (xlat = resources; xlat->str; ++xlat) { - unsigned long res = 0xfacefeed00000000 | xlat->val; + unsigned long res = 0xfacefeed00000000ULL | xlat->val; long rc = syscall(NR_GETRLIMIT, res, 0); if (rc && ENOSYS == errno) perror_msg_and_skip(STR_GETRLIMIT); diff --git a/tests/xstatfsx.c b/tests/xstatfsx.c index c5c04be2..372fc916 100644 --- a/tests/xstatfsx.c +++ b/tests/xstatfsx.c @@ -110,7 +110,7 @@ main(void) printf("NULL) = %s\n", errstr); #ifdef CHECK_ODD_SIZE - const unsigned long addr = (unsigned long) 0xfacefeeddeadbeef; + const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; rc = SYSCALL_INVOKE("", -1, addr, sizeof(STRUCT_STATFS) + 1); errstr = sprintrc(rc); PRINT_SYSCALL_HEADER("", -1, sizeof(STRUCT_STATFS) + 1); diff --git a/tests/xstatx.c b/tests/xstatx.c index 2fda6f81..12da191c 100644 --- a/tests/xstatx.c +++ b/tests/xstatx.c @@ -71,7 +71,7 @@ print_time(const time_t t) # define STRUCT_STAT_IS_STAT64 0 # endif # ifndef SAMPLE_SIZE -# define SAMPLE_SIZE 43147718418 +# define SAMPLE_SIZE 43147718418ULL # endif typedef off_t libc_off_t;