How about I change to 'unsigned int', rather than 'int', since
the val is assigned to an unsigned char? Is your compiler cool
with that?
-Kevin
Jeff Dubrule wrote:
>
> secret-lab:~/src/build/plex86/kernel$ make monprint.o
> gcc -c -g -O2 -Wall -Wstrict-prototypes -fno-strength-reduce -fomit-frame-pointer
>-malign-loops=2 -malign-jumps=2 -malign-functions=2 -D__KERNEL__
>-I/usr/src/linux/include -DCPU=586 -DMODULE -I./include -I./.. -I.. monprint.c
> monprint.c:83:2: warning: #warning "clean up this hack"
> monprint.c: In function `mon_vsnprintf':
> monprint.c:216: `unsigned char' is promoted to `int' when passed through `...'
> monprint.c:216: (so you should pass `int' not `unsigned char' to `va_arg')
> make: *** [monprint.o] Error 1
>
> *shrug*
>
> Unless anyone has a better fix:
> Index: kernel/monprint.c
> ===================================================================
> RCS file: /cvsroot-plex86/plex86/kernel/monprint.c,v
> retrieving revision 1.4
> diff -u -r1.4 monprint.c
> --- kernel/monprint.c 2000/10/26 18:24:50 1.4
> +++ kernel/monprint.c 2000/10/27 14:11:16
> @@ -213,7 +213,7 @@
> /* %c: character */
> if ( c == 'c' ) {
> unsigned char val;
> - val = va_arg(args, unsigned char);
> + val = va_arg(args, int);
> if ( (count+2) >= size ) goto error;
> *str++ = val;
> count++;