Skip to content

Commit e67c8e4

Browse files
committed
Replace %Ld/%Lu printf format specifiers with %lld/%llu
As %Ld and %Lu printf format specifiers are not quite portable, replace them with %lld and %llu, respectively. * desc.c (SYS_FUNC(pselect6)): Replace %Lu with %llu. * dirent.c (print_old_dirent, SYS_FUNC(getdents)): Likewise. * times.c (SYS_FUNC(times)): Likewise. * fcntl.c (print_struct_flock64): Replace %Ld with %lld. * tests/ftruncate.c (main): Replace %Lu with %llu. * tests/ftruncate64.c (main): Likewise. * tests/getdents.c (print_dirent): Likewise. * tests/llseek.c (main): Likewise. * tests/lseek.c (main): Likewise. * tests/truncate.c (main): Likewise. * tests/truncate64.c (main): Likewise. * tests/xstatx.c (main): Likewise. * tests/pselect6.c (main): Replace %Ld with %lld. * tests/xselect.c(main): Likewise. Reported-by: Szabolcs Nagy <[email protected]>
1 parent 34683e3 commit e67c8e4

File tree

14 files changed

+20
-20
lines changed

14 files changed

+20
-20
lines changed

desc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ SYS_FUNC(pselect6)
270270
/* NB: kernel requires data[1] == NSIG / 8 */
271271
print_sigset_addr_len(tcp, (unsigned long) data[0],
272272
(unsigned long) data[1]);
273-
tprintf(", %Lu}", (unsigned long long) data[1]);
273+
tprintf(", %llu}", (unsigned long long) data[1]);
274274
}
275275
}
276276

dirent.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ print_old_dirent(struct tcb *tcp, long addr)
4747
if (umove_or_printaddr(tcp, addr, &d))
4848
return;
4949

50-
tprintf("{d_ino=%Lu, d_off=%Lu, d_reclen=%u, d_name=",
50+
tprintf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=",
5151
(unsigned long long) d.d_ino,
5252
(unsigned long long) d.d_off, d.d_reclen);
5353
if (d.d_reclen > D_NAME_LEN_MAX)
@@ -122,7 +122,7 @@ SYS_FUNC(getdents)
122122
if (d_name_len > D_NAME_LEN_MAX)
123123
d_name_len = D_NAME_LEN_MAX;
124124

125-
tprintf("%s{d_ino=%Lu, d_off=%Lu, d_reclen=%u"
125+
tprintf("%s{d_ino=%llu, d_off=%llu, d_reclen=%u"
126126
", d_name=", i ? ", " : "",
127127
(unsigned long long) d->d_ino,
128128
(unsigned long long) d->d_off, d->d_reclen);

fcntl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ print_struct_flock64(const struct_kernel_flock64 *fl, const int getlk)
4646
printxval(lockfcmds, fl->l_type, "F_???");
4747
tprints(", l_whence=");
4848
printxval(whence_codes, fl->l_whence, "SEEK_???");
49-
tprintf(", l_start=%Ld, l_len=%Ld",
49+
tprintf(", l_start=%lld, l_len=%lld",
5050
(long long) fl->l_start, (long long) fl->l_len);
5151
if (getlk)
5252
tprintf(", l_pid=%lu", (unsigned long) fl->l_pid);

tests/ftruncate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ main(void)
5353
if (rc != -1 || EBADF != errno)
5454
return 77;
5555

56-
printf("ftruncate(-1, %Lu) = -1 EBADF (Bad file descriptor)\n",
56+
printf("ftruncate(-1, %llu) = -1 EBADF (Bad file descriptor)\n",
5757
(unsigned long long) len);
5858

5959
puts("+++ exited with 0 +++");

tests/ftruncate64.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ main(void)
4646
if (rc != -1 || EBADF != errno)
4747
return 77;
4848

49-
printf("ftruncate64(-1, %Lu) = -1 EBADF (Bad file descriptor)\n",
49+
printf("ftruncate64(-1, %llu) = -1 EBADF (Bad file descriptor)\n",
5050
(unsigned long long) len);
5151

5252
puts("+++ exited with 0 +++");

tests/getdents.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ print_dirent(const kernel_dirent *d)
8383
int d_name_len = d->d_reclen - d_name_offset - 1;
8484
assert(d_name_len > 0);
8585

86-
printf("{d_ino=%Lu, d_off=%Lu, d_reclen=%u, d_name=",
86+
printf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=",
8787
(unsigned long long) d->d_ino,
8888
(unsigned long long) d->d_off, d->d_reclen);
8989

tests/llseek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ main(void)
4949
if (rc != -1 || EBADF != errno)
5050
return 77;
5151

52-
printf("_llseek(-1, %Lu, %p, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
52+
printf("_llseek(-1, %llu, %p, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
5353
offset, &result);
5454

5555
puts("+++ exited with 0 +++");

tests/lseek.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ main(void)
5353
if (rc != -1 || EBADF != errno)
5454
return 77;
5555

56-
printf("lseek(-1, %Lu, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
56+
printf("lseek(-1, %llu, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
5757
(unsigned long long) offset);
5858

5959
puts("+++ exited with 0 +++");

tests/pselect6.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ int main(int ac, char **av)
9696
FD_SET(fds[1], set[1]);
9797
if (syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) != 3)
9898
return 77;
99-
printf("pselect6(%d, NULL, [1 2 %d %d], NULL, {%Ld, %Ld}, NULL)"
100-
" = 3 (out [1 2 %d], left {%Ld, %Ld})\n",
99+
printf("pselect6(%d, NULL, [1 2 %d %d], NULL, {%lld, %lld}, NULL)"
100+
" = 3 (out [1 2 %d], left {%lld, %lld})\n",
101101
fds[1] + 1, fds[0], fds[1],
102102
(long long) tm_in.ts.tv_sec, (long long) tm_in.ts.tv_nsec,
103103
fds[1],

tests/truncate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ main(void)
5555
if (rc != -1 || ENOENT != errno)
5656
return 77;
5757

58-
printf("truncate(\"%s\", %Lu) = -1 ENOENT (No such file or directory)\n",
58+
printf("truncate(\"%s\", %llu) = -1 ENOENT (No such file or directory)\n",
5959
qname, (unsigned long long) len);
6060

6161
puts("+++ exited with 0 +++");

0 commit comments

Comments
 (0)