Skip to content

Commit 1b2becf

Browse files
meelisroosLinus Torvalds
authored andcommitted
alpha: fix objstrip.c compilation warnings
In current 2.6.23-rc1+git, make bootimage gives the following warnings while compiling objstrip.c. The patch below fixes these warnings by casting strncmp argument to char * - it does not seem feasible to change its type in struct elfhdr. HOSTCC arch/alpha/boot/tools/objstrip arch/alpha/boot/tools/objstrip.c: In function 'main': arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of 'strlen' differ in signedness arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of '__builtin_strcmp' differ in signedness arch/alpha/boot/tools/objstrip.c:147: warning: pointer targets in passing argument 1 of 'strncmp' differ in signedness Signed-off-by: Meelis Roos <mroos@linux.ee> Cc: Jay Estabrook <jay.estabrook@hp.com> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Cc: Richard Henderson <rth@twiddle.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent aeb3f46 commit 1b2becf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎arch/alpha/boot/tools/objstrip.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ main (int argc, char *argv[])
144144
#ifdef __ELF__
145145
elf = (struct elfhdr *) buf;
146146

147-
if (elf->e_ident[0] == 0x7f && strncmp(elf->e_ident + 1, "ELF", 3) == 0) {
147+
if (elf->e_ident[0] == 0x7f && strncmp((char *)elf->e_ident + 1, "ELF", 3) == 0) {
148148
if (elf->e_type != ET_EXEC) {
149149
fprintf(stderr, "%s: %s is not an ELF executable\n",
150150
prog_name, inname);

0 commit comments

Comments
 (0)