Re: Kernel printk format string compression: C syntax problem

Bryan O'Sullivan (bos@serpentine.com)
06 Jun 2003 11:01:36 -0700


On Fri, 2003-06-06 at 10:27, Timothy Miller wrote:

> printk( "EIP\200\3164x:[<\3168lx>] CPU\200%d\n" ,0xffff &
> regs->xcs,regs->eip, (current_thread_info()->cpu));
>
> GCC 3.0.4 makes the following complaint:
>
> arch/i386/kernel/process.c:173: warning: too many arguments for format
>
> What I believe is happening is that where I have the escape code "\316"
> concatenated with the literal "8", the compiler is seeing it as "\3168"
> and doesn't want to take it.

No. Look at the __attribute__ on printk in include/linux/kernel.h. GCC
believes that printk takes a printf-style format string as its first
argument, but you've mangled the string so that the number of format
specifiers doesn't match the number of arguments.

<b

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/