arch: x86: entry: vdso: fix type conversion on printf() call
Subsystems (3)
PATCH 1/1 arch: x86: entry: vdso: fix type conversion on printf() call
Fixing the following compiler warning by explicit conversion to long:
In file included from /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:162:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract64':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
^
CC mm/filemap.o
In file included from /home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:166:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract32':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t {aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
--- arch/x86/entry/vdso/vdso2c.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/x86/entry/vdso/vdso2c.h +2 -1
@@ -35,7 +35,8 @@ static void BITSFUNC(extract)(const unsigned char *data, size_t data_len,if (offset + len > data_len)fail ("section to extract overruns input data" ); -fprintf (outfile,"static const unsigned char %s[%lu] = {" , name, len); +fprintf (outfile,"static const unsigned char %s[%lu] = {" , name, + (unsigned long )len);BITSFUNC (copy)(outfile, data + offset, len);fprintf (outfile,"\n};\n\n" ); }
Signature · 1 line
2.11.0
Andy Lutomirski
maintainerQuoted 24 lines · metux IT consult
Fixing the following compiler warning by explicit conversion to long:
In file included from
/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:162:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract64':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);^CC
mm/filemap.o
In file included from/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:166:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract32':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- arch/x86/entry/vdso/vdso2c.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)arch/x86/entry/vdso/vdso2c.h +0
-0
arch/x86/entry/vdso/vdso2c.h static void BITSFUNC(extract)(const unsigned char *data, size_t data_len, · line 39
Quoted 6 lines
arch/x86/entry/vdso/vdso2c.h +2
-1@@ -35,7 +35,8 @@ static void BITSFUNC(extract)(const unsigned char *data, size_t data_len,if (offset + len > data_len)fail ("section to extract overruns input data" ); -fprintf (outfile,"static const unsigned char %s[%lu] = {" , name, len); +fprintf (outfile,"static const unsigned char %s[%lu] = {" , name, + (unsigned long )len);
This would be nicer if you put the line break after the equal sign and before the {.
--Andy
Quoted 13 lines · metux IT consult
Fixing the following compiler warning by explicit conversion to long:
In file included from
/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:162:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract64':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);^CC
mm/filemap.o
In file included from/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:166:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract32':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);
Quoted 4 lines
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- arch/x86/entry/vdso/vdso2c.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Hi,
size_t is normally printed with %zu.
Is there some reason that isn't being used here?
Quoted 6 lines
arch/x86/entry/vdso/vdso2c.h +0
-0
arch/x86/entry/vdso/vdso2c.h static void BITSFUNC(extract)(const unsigned char *data, size_t data_len, · line 42
Quoted 9 lines
arch/x86/entry/vdso/vdso2c.h +2
-1@@ -35,7 +35,8 @@ static void BITSFUNC(extract)(const unsigned char *data, size_t data_len,if (offset + len > data_len)fail ("section to extract overruns input data" ); -fprintf (outfile,"static const unsigned char %s[%lu] = {" , name, len); +fprintf (outfile,"static const unsigned char %s[%lu] = {" , name, + (unsigned long )len);BITSFUNC (copy)(outfile, data + offset, len);fprintf (outfile,"\n};\n\n" ); }
thanks.
Signature · 1 line
~Randy
Andy Lutomirski
maintainerQuoted 20 lines · Randy Dunlap
Quoted 13 lines · metux IT consult
Fixing the following compiler warning by explicit conversion to long:
In file included from
/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:162:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract64':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);^CC
mm/filemap.o
In file included from/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:166:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract32':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);Quoted 4 lines
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- arch/x86/entry/vdso/vdso2c.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 4 lines
Hi,
size_tis normally printed with %zu.
Is there some reason that isn't being used here?
No. Want to send a patch?
Quoted 21 lines · Andy Lutomirski
Quoted 20 lines · Randy Dunlap
Quoted 17 lines · metux IT consult
Fixing the following compiler warning by explicit conversion to long:
In file included from
/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:162:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract64':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);^CC
mm/filemap.o
In file included from/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:166:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract32':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- arch/x86/entry/vdso/vdso2c.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 7 lines
Quoted 4 lines
Hi,
size_tis normally printed with %zu.
Is there some reason that isn't being used here?No. Want to send a patch?
I was hoping that Enrico would fix this and maybe address your other comment, although I'm not so sure that I agree with it.
Signature · 1 line
~Randy
Andy Lutomirski
maintainerQuoted 25 lines · Randy Dunlap
Quoted 23 lines · Andy Lutomirski
Quoted 22 lines · Randy Dunlap
Quoted 13 lines · metux IT consult
Fixing the following compiler warning by explicit conversion to long:
In file included from
/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:162:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract64':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);^CC
mm/filemap.o
In file included from/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.c:166:0:/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h: In function 'extract32':/home/nekrad/src/apu2-dev/pkg/kernel.apu2.git/arch/x86/entry/vdso/vdso2c.h:38:52: warning: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'size_t{aka unsigned int}' [-Wformat=]
fprintf(outfile, "static const unsigned char %s[%lu] = {", name, len);Quoted 4 lines
Signed-off-by Enrico Weigelt, metux IT consult <[email protected]>--- arch/x86/entry/vdso/vdso2c.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)Hi,
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
size_tis normally printed with %zu.
Is there some reason that isn't being used here?No. Want to send a patch?
I was hoping that Enrico would fix this and maybe address your other comment, although I'm not so sure that I agree with it.
Using %zu would get rid of the line break entirely. Enrico?
Quoted 4 lines
--
~Randy
Quoted 10 lines · Andy Lutomirski
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
size_tis normally printed with %zu.
Is there some reason that isn't being used here?No. Want to send a patch?
I was hoping that Enrico would fix this and maybe address your other comment, although I'm not so sure that I agree with it.
Using %zu would get rid of the line break entirely. Enrico?
you're both rigth. I'll send a v2 of the patch
--mtx
Signature · 8 lines
--- Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren GPG/PGP-Schlüssel zu. --- Enrico Weigelt, metux IT consult Free software and Linux embedded engineering [email protected] -- +49-151-27565287