var args in kernel?

From: Gerd Knorr
Date: Mon Nov 22 2004 - 05:02:52 EST


On Fri, Nov 19, 2004 at 02:41:46PM -0700, Kevin P. Fleming wrote:
> Gerd Knorr wrote:
> >Yet another kobject bug. It uses the varargs list twice in a illegal
> >way. That doesn't harm on i386 by pure luck, but blows things up on
> >amd64 machines. The patch below fixes it.
>
> Is this safe? The normal glibc varargs implementation says you can't
> even call va_start on the same args list twice, you have to use va_copy
> to make a clone and then call va_start on that, _before_ you ever call
> va_start the first time.

Hmm, maybe. I'm not sure who actually implements the varargs (gcc?
Or glibc/kernel?) and whenever the above applies to the kernel as well
or not ...

Cc'ing the kernel list for comments.

Gerd

--
#define printk(args...) fprintf(stderr, ## args)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/