Skip to contentSkip to conversation

kexec, i386: Fix build warning of size_t print

PATCH Applied Zhang Yanfei 3 participants 6 messages Apr 6, 2013 – Apr 8, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kexec, i386: Fix build warning of size_t print

From: Zhang Yanfei <[email protected]>

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

---
 kexec/kexec-elf-rel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec-elf-rel.c +2 -2
index 38e34ec..6acd50d 100644
@@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
                        name);
        }
        if (sym.st_size != size) {
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
@@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
                die("Symbol: %s not found cannot get\n", name);
        }
        if (sym.st_size != size) {
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
Signature · 6 lines
1.7.1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 11 lines · Zhang Yanfei

From: Zhang Yanfei <[email protected]>

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

Thanks,

This change looks good to me, however, the patch does not appear to apply on the master branch of the kexec-tools tree. Could you rebase and repost it?

Quoted 31 lines
---
 kexec/kexec-elf-rel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec-elf-rel.c +2 -2
index 38e34ec..6acd50d 100644
@@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
                        name);
        }
        if (sym.st_size != size) {
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
@@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
                die("Symbol: %s not found cannot get\n", name);
        }
        if (sym.st_size != size) {
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
Signature · 1 line
1.7.1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#2 lore raw
Quoted 10 lines · Simon Horman
Quoted 9 lines · Zhang Yanfei

From: Zhang Yanfei <[email protected]>

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

Quoted 8 lines
Quoted 2 lines

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

Thanks,

This change looks good to me, however, the patch does not appear to apply on the master branch of the kexec-tools tree. Could you rebase and repost it?

Really? Maybe I made some mistake. Anyway I will regenerate it and resend it again.

Thanks
Zhang

Quoted 24 lines
Quoted 24 lines
---
 kexec/kexec-elf-rel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec-elf-rel.c +1 -1
index 38e34ec..6acd50d 100644
@@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
                        name);
        }
        if (sym.st_size != size) {
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
@@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
                die("Symbol: %s not found cannot get\n", name);
        }
        if (sym.st_size != size) {
Quoted 9 lines
Quoted 8 lines
kexec/kexec-elf-rel.c +1 -1
-               die("Symbol: %s has size: %lld not %ld\n",
+               die("Symbol: %s has size: %lld not %zd\n",
                        name, sym.st_size, size);
        }
        shdr = &ehdr->e_shdr[sym.st_shndx];
Signature · 1 line
1.7.1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#3 lore raw
Quoted 14 lines · Zhang Yanfei
Quoted 13 lines · Simon Horman
Quoted 11 lines · Zhang Yanfei

From: Zhang Yanfei <[email protected]>

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

Quoted 8 lines
Quoted 5 lines

Thanks,

This change looks good to me, however, the patch does not appear to apply on the master branch of the kexec-tools tree. Could you rebase and repost it?

Really? Maybe I made some mistake. Anyway I will regenerate it and resend it again.

Perhaps I made a mistake ^)

The head commit I have is:

commit 969f3e8c1c534f63b869183ccf292bcaef0e5558

Author: Richard Weinberger <[email protected]>
Date:   Mon Apr 1 13:23:04 2013 +0200

purgatory: remove arch/i386/timer.c

This file is nowhere referenced, let's get rid of it.

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

#4 lore raw
Quoted 32 lines · Simon Horman
Quoted 14 lines · Zhang Yanfei
Quoted 13 lines · Simon Horman
Quoted 11 lines · Zhang Yanfei

From: Zhang Yanfei <[email protected]>

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

Quoted 8 lines
Quoted 5 lines

Thanks,

This change looks good to me, however, the patch does not appear to apply on the master branch of the kexec-tools tree. Could you rebase and repost it?

Really? Maybe I made some mistake. Anyway I will regenerate it and resend it again.

Perhaps I made a mistake ^)

The head commit I have is:

commit 969f3e8c1c534f63b869183ccf292bcaef0e5558

Author: Richard Weinberger <[email protected]>
Date:   Mon Apr 1 13:23:04 2013 +0200
Quoted 7 lines

purgatory: remove arch/i386/timer.c

This file is nowhere referenced, let's get rid of it.

Same with you.

I regenerate one, see below:
---------------------------------------------

From: Zhang Yanfei <[email protected]>
Date: Mon, 8 Apr 2013 02:05:07 +0800
Subject: [PATCH] kexec, i386: Fix build warning of size_t print

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

---
 kexec/kexec-elf-rel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec-elf-rel.c +2 -2
index 38e34ec..f59140f 100644
@@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
 			name);
 	}
 	if (sym.st_size != size) {
-		die("Symbol: %s has size: %lld not %ld\n",
+		die("Symbol: %s has size: %lld not %zd\n",
 			name, sym.st_size, size);
 	}
 	shdr = &ehdr->e_shdr[sym.st_shndx];
@@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
 		die("Symbol: %s not found cannot get\n", name);
 	}
 	if (sym.st_size != size) {
-		die("Symbol: %s has size: %lld not %ld\n",
+		die("Symbol: %s has size: %lld not %zd\n",
 			name, sym.st_size, size);
 	}
 	shdr = &ehdr->e_shdr[sym.st_shndx];
Signature · 7 lines
1.7.1


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Applied
#5 lore raw
Quoted 37 lines · Zhang Yanfei
Quoted 36 lines · Simon Horman
Quoted 14 lines · Zhang Yanfei
Quoted 13 lines · Simon Horman
Quoted 11 lines · Zhang Yanfei

From: Zhang Yanfei <[email protected]>

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

Quoted 8 lines
Quoted 5 lines

Thanks,

This change looks good to me, however, the patch does not appear to apply on the master branch of the kexec-tools tree. Could you rebase and repost it?

Really? Maybe I made some mistake. Anyway I will regenerate it and resend it again.

Perhaps I made a mistake ^)

The head commit I have is:

commit 969f3e8c1c534f63b869183ccf292bcaef0e5558

Author: Richard Weinberger <[email protected]>
Date:   Mon Apr 1 13:23:04 2013 +0200

purgatory: remove arch/i386/timer.c

This file is nowhere referenced, let's get rid of it.

Quoted 7 lines
Quoted 3 lines

Same with you.

I regenerate one, see below:

Thanks, applied.

Quoted 47 lines

---------------------------------------------

From: Zhang Yanfei <[email protected]>
Date: Mon, 8 Apr 2013 02:05:07 +0800
Subject: [PATCH] kexec, i386: Fix build warning of size_t print

When compile kexec-tools in i386, we got the following warnings:

kexec/kexec-elf-rel.c: In function ‘elf_rel_set_symbol’:
kexec/kexec-elf-rel.c:517: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’ kexec/kexec-elf-rel.c: In function ‘elf_rel_get_symbol’:
kexec/kexec-elf-rel.c:541: warning: format ‘%ld’ expects type ‘long int’, but argument 4 has type ‘size_t’

This is because the two functions output a size_t value as %ld when it should be %zd, resulting in this warning.

---
 kexec/kexec-elf-rel.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec-elf-rel.c +2 -2
index 38e34ec..f59140f 100644
@@ -513,7 +513,7 @@ void elf_rel_set_symbol(struct mem_ehdr *ehdr,
 			name);
 	}
 	if (sym.st_size != size) {
-		die("Symbol: %s has size: %lld not %ld\n",
+		die("Symbol: %s has size: %lld not %zd\n",
 			name, sym.st_size, size);
 	}
 	shdr = &ehdr->e_shdr[sym.st_shndx];
@@ -537,7 +537,7 @@ void elf_rel_get_symbol(struct mem_ehdr *ehdr,
 		die("Symbol: %s not found cannot get\n", name);
 	}
 	if (sym.st_size != size) {
-		die("Symbol: %s has size: %lld not %ld\n",
+		die("Symbol: %s has size: %lld not %zd\n",
 			name, sym.st_size, size);
 	}
 	shdr = &ehdr->e_shdr[sym.st_shndx];
Signature · 1 line
1.7.1

_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec