Re: [RFC PATCH v1 2/3] Add %v support to vsnprintf()

From: Linus Torvalds
Date: Sat Dec 06 2008 - 12:27:43 EST




On Sat, 6 Dec 2008, Nick Andrew wrote:
>
> Add %v support to vsnprintf()

No can do. gcc will always warn, and I don't want to see an extension that
will generate unfixable warnings.

If you want to do this, you'd need to do it the same way we did some othe
printf extensions, ie by not passing the valist entry itself, but
passing the _pointer_ to it, and using "%pV" as the format modifier.

(Quite frankly, "va_list" can be rather large, so passing a pointer to it
is probably a better idea anyway).

Of course, gcc may implement "va_list" as an array (or just a pointer)
internally, and then it will be passed as a pointer anyway (and you'd not
need the address-of), but that's certainly not in any way guaranteed, and
is very possibly architecture-dependent.

Linus
--
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/