Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

alpha: fix mkbb compilation warnings

In current 2.6.23-rc1+git, make bootimage gives the following warnings while
compiling mkbb.c. The patch below fixes these warnings by using the proper
include for exit() and using appropriate printf format.

HOSTCC arch/alpha/boot/tools/mkbb
arch/alpha/boot/tools/mkbb.c: In function 'main':
arch/alpha/boot/tools/mkbb.c:95: warning: implicit declaration of function 'exit'
arch/alpha/boot/tools/mkbb.c:95: warning: incompatible implicit declaration of built-in function 'exit'
arch/alpha/boot/tools/mkbb.c:102: warning: incompatible implicit declaration of built-in function 'exit'
arch/alpha/boot/tools/mkbb.c:110: warning: incompatible implicit declaration of built-in function 'exit'
arch/alpha/boot/tools/mkbb.c:117: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
arch/alpha/boot/tools/mkbb.c:118: warning: incompatible implicit declaration of built-in function 'exit'
arch/alpha/boot/tools/mkbb.c:125: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
arch/alpha/boot/tools/mkbb.c:126: warning: incompatible implicit declaration of built-in function 'exit'
arch/alpha/boot/tools/mkbb.c:143: warning: incompatible implicit declaration of built-in function 'exit'
arch/alpha/boot/tools/mkbb.c:148: warning: incompatible implicit declaration of built-in function 'exit'

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>

authored by

Meelis Roos and committed by
Linus Torvalds
aeb3f462 60fd4d6a

+3 -2
+3 -2
arch/alpha/boot/tools/mkbb.c
··· 11 11 12 12 #include <fcntl.h> 13 13 #include <unistd.h> 14 + #include <stdlib.h> 14 15 #include <stdio.h> 15 16 16 17 /* Minimal definition of disklabel, so we don't have to include ··· 115 114 nread = read(fd, &bootloader_image, sizeof(bootblock)); 116 115 if(nread != sizeof(bootblock)) { 117 116 perror("lxboot read"); 118 - fprintf(stderr, "expected %d, got %d\n", sizeof(bootblock), nread); 117 + fprintf(stderr, "expected %zd, got %d\n", sizeof(bootblock), nread); 119 118 exit(0); 120 119 } 121 120 ··· 123 122 nread = read(dev, &bootblock_from_disk, sizeof(bootblock)); 124 123 if(nread != sizeof(bootblock)) { 125 124 perror("bootblock read"); 126 - fprintf(stderr, "expected %d, got %d\n", sizeof(bootblock), nread); 125 + fprintf(stderr, "expected %zd, got %d\n", sizeof(bootblock), nread); 127 126 exit(0); 128 127 } 129 128