linux-next: build warnings after merge of the vfs-brauner tree
Hi all,
After merging the vfs-brauner tree, today's linux-next build (powerpc allyesconfig) produced these warnings:
samples/vfs/mountinfo.c: In function 'show_propagation':samples/vfs/mountinfo.c:104:36: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=]
104 | printf(" shared:%llu", sm->mnt_peer_group);
| ~~~^ ~~~~~~~~~~~~~~~~~~
| | |
| | __u64 {aka long unsigned int}
| long long unsigned int
| %lu
samples/vfs/mountinfo.c:106:36: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=]
106 | printf(" master:%llu", sm->mnt_master);
| ~~~^ ~~~~~~~~~~~~~~
| | |
| | __u64 {aka long unsigned int}
| long long unsigned int
| %lu
samples/vfs/mountinfo.c:108:52: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=]
108 | printf(" propagate_from:%llu", sm->propagate_from);
| ~~~^ ~~~~~~~~~~~~~~~~~~
| | |
| | __u64 {aka long unsigned int}
| long long unsigned int
| %lu
samples/vfs/mountinfo.c: In function 'dump_mountinfo':
samples/vfs/mountinfo.c:144:42: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type '__u64' {aka 'long unsigned int'} [-Wformat=]
144 | printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf->mnt_parent_id);
| ~~~^ ~~~~~~~~~~~~~~~~~~
| | |
| long long unsigned int __u64 {aka long unsigned int}
| %lxIntroduced by commits
0c8f746452aa ("samples: add a mountinfo program to demonstrate statmount()/listmount()") ee8c840a4a35 ("samples: fix missing nodiratime option and handle propagate_from correctly")
I am not sure why these warnings only turned up today.
Signature · 2 lines
Cheers, Stephen Rothwell
Hi all,
Quoted 34 lines · On Wed, 11 Dec 2024 14:37:01 +1100 Stephen Rothwell <[email protected]>…
After merging the vfs-brauner tree, today's linux-next build (powerpc allyesconfig) produced these warnings:
samples/vfs/mountinfo.c: In function 'show_propagation':samples/vfs/mountinfo.c:104:36: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=]104 | printf(" shared:%llu", sm->mnt_peer_group); | ~~~^ ~~~~~~~~~~~~~~~~~~ | | | | | __u64 {aka long unsigned int} | long long unsigned int | %lu samples/vfs/mountinfo.c:106:36: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=] 106 | printf(" master:%llu", sm->mnt_master); | ~~~^ ~~~~~~~~~~~~~~ | | | | | __u64 {aka long unsigned int} | long long unsigned int | %lu samples/vfs/mountinfo.c:108:52: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=] 108 | printf(" propagate_from:%llu", sm->propagate_from); | ~~~^ ~~~~~~~~~~~~~~~~~~ | | | | | __u64 {aka long unsigned int} | long long unsigned int | %lu samples/vfs/mountinfo.c: In function 'dump_mountinfo': samples/vfs/mountinfo.c:144:42: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type '__u64' {aka 'long unsigned int'} [-Wformat=] 144 | printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf->mnt_parent_id); | ~~~^ ~~~~~~~~~~~~~~~~~~ | | | | long long unsigned int __u64 {aka long unsigned int} | %lx
Quoted 6 lines
Introduced by commits
0c8f746452aa("samples: add a mountinfo program to demonstrate statmount()/listmount()")ee8c840a4a35("samples: fix missing nodiratime option and handlepropagate_fromcorrectly")I am not sure why these warnings only turned up today.
I am still seeing these warnings.
Signature · 2 lines
Cheers, Stephen Rothwell
Quoted 37 lines · Stephen Rothwell
Hi all,
Quoted 34 lines · On Wed, 11 Dec 2024 14:37:01 +1100 Stephen Rothwell <[email protected]>…
After merging the vfs-brauner tree, today's linux-next build (powerpc allyesconfig) produced these warnings:
samples/vfs/mountinfo.c: In function 'show_propagation':samples/vfs/mountinfo.c:104:36: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=]104 | printf(" shared:%llu", sm->mnt_peer_group); | ~~~^ ~~~~~~~~~~~~~~~~~~ | | | | | __u64 {aka long unsigned int} | long long unsigned int | %lu samples/vfs/mountinfo.c:106:36: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=] 106 | printf(" master:%llu", sm->mnt_master); | ~~~^ ~~~~~~~~~~~~~~ | | | | | __u64 {aka long unsigned int} | long long unsigned int | %lu samples/vfs/mountinfo.c:108:52: warning: format '%llu' expects argument of type 'long long unsigned int', but argument 2 has type '__u64' {aka 'long unsigned int'} [-Wformat=] 108 | printf(" propagate_from:%llu", sm->propagate_from); | ~~~^ ~~~~~~~~~~~~~~~~~~ | | | | | __u64 {aka long unsigned int} | long long unsigned int | %lu samples/vfs/mountinfo.c: In function 'dump_mountinfo': samples/vfs/mountinfo.c:144:42: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type '__u64' {aka 'long unsigned int'} [-Wformat=] 144 | printf("0x%lx 0x%lx 0x%llx ", mnt_ns_id, mnt_id, buf->mnt_parent_id); | ~~~^ ~~~~~~~~~~~~~~~~~~ | | | | long long unsigned int __u64 {aka long unsigned int} | %lx
Quoted 8 lines
Quoted 6 lines
Introduced by commits
0c8f746452aa("samples: add a mountinfo program to demonstrate statmount()/listmount()")ee8c840a4a35("samples: fix missing nodiratime option and handlepropagate_fromcorrectly")I am not sure why these warnings only turned up today.
I am still seeing these warnings.
I'm not sure how to fix this the right way.
The problem seems to be a discrepancy in the __u64 type between arches. Changing these in a way that would make PPC happy causes these warnings on x86_64:
gcc -Wp,-MMD,./.mountinfo.d -Wall -Wmissing-prototypes -Wstrict-prototypes -O2 -fomit-frame-pointer -std=gnu11 -m64 -I usr/include -m64 -o mountinfo mountinfo.cmountinfo.c: In function ‘show_propagation’:
mountinfo.c:104:35: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘__u64’ {aka ‘long long unsigned int’} [-Wformat=]
104 | printf(" shared:%lu", sm->mnt_peer_group);
| ~~^ ~~~~~~~~~~~~~~~~~~
| | |
| | __u64 {aka long long unsigned int}
| long unsigned int
| %llu
mountinfo.c:106:35: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘__u64’ {aka ‘long long unsigned int’} [-Wformat=]
106 | printf(" master:%lu", sm->mnt_master);
| ~~^ ~~~~~~~~~~~~~~
| | |
| | __u64 {aka long long unsigned int}
| long unsigned int
| %llu
mountinfo.c:108:51: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 2 has type ‘__u64’ {aka ‘long long unsigned int’} [-Wformat=]
108 | printf(" propagate_from:%lu", sm->propagate_from);
| ~~^ ~~~~~~~~~~~~~~~~~~
| | |
| | __u64 {aka long long unsigned int}
| long unsigned int
| %llu
mountinfo.c: In function ‘dump_mountinfo’:
mountinfo.c:144:41: warning: format ‘%lx’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘__u64’ {aka ‘long long unsigned int’} [-Wformat=]
144 | printf("0x%lx 0x%lx 0x%lx ", mnt_ns_id, mnt_id, buf->mnt_parent_id);
| ~~^ ~~~~~~~~~~~~~~~~~~
| | |
| long unsigned int __u64 {aka long long unsigned int}
| %llxWhat format specifier should we be using that would make both arches happy?
Thanks,
Signature · 1 line
Jeff Layton <[email protected]>
Hi Jeff,
Quoted 2 lines · On Thu, 19 Dec 2024 07:40:05 -0500 Jeff Layton <[email protected]> wrote:
I'm not sure how to fix this the right way.
Some other samples define __SANE_USERSPACE_TYPES__ ...
Signature · 2 lines
Cheers, Stephen Rothwell
Hi Stephen,
Quoted 5 lines · Stephen Rothwell
Quoted 2 lines · On Thu, 19 Dec 2024 07:40:05 -0500 Jeff Layton <[email protected]> wrote:
I'm not sure how to fix this the right way.
Some other samples define
__SANE_USERSPACE_TYPES__...
Which is now used by samples/vfs/mountinfo.c... However, it's still broken on 32-bit. I have sent a fix.
https://lore.kernel.org/[email protected]
Gr{oetje,eeting}s,
Geert
Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected] In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds