offsetof.3: Use "%zu" rather than "%zd" when printing 'size_t' values

Signed-off-by: Alejandro Colomar <colomar.6.4.3@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Alejandro Colomar 2020-09-10 23:13:26 +02:00 committed by Michael Kerrisk
parent 288d42bc37
commit 2bbfed1b16
1 changed files with 2 additions and 2 deletions

View File

@ -93,10 +93,10 @@ main(void)
/* Output is compiler dependent */
printf("offsets: i=%zd; c=%zd; d=%zd a=%zd\en",
printf("offsets: i=%zu; c=%zu; d=%zu a=%zu\en",
offsetof(struct s, i), offsetof(struct s, c),
offsetof(struct s, d), offsetof(struct s, a));
printf("sizeof(struct s)=%zd\en", sizeof(struct s));
printf("sizeof(struct s)=%zu\en", sizeof(struct s));
exit(EXIT_SUCCESS);
}