VA_LIST problem on OSR5....

Zack Weinberg
Sun Feb 20 15:10:00 GMT 2000

On Sun, Feb 20, 2000 at 02:23:33PM -0800, Bruce Korb wrote:
>     sed = "s@ va_list @ __gnuc_va_list @\n"
>           "s@ va_list)@ __gnuc_va_list)@\n"
>           "s@ _VA_LIST_));@ __gnuc_va_list));@\n"
>***        "s@ va_list@ __not_va_list__@\n"
>           "s@\\*va_list@*__not_va_list__@\n"
>           "s@ __va_list)@ __gnuc_va_list)@\n"
>           "s@GNUC_VA_LIST@GNUC_Va_LIST@\n"
>           "s@_NEED___VA_LIST@_NEED___Va_LIST@\n"
>           "s@VA_LIST@DUMMY_VA_LIST@\n"
>           "s@_Va_LIST@_VA_LIST@";
> Does anyone see a problem with adding:
>           "s@typedef[ \t]\\(.*\\)[ \t]va_list[ \t]*;"
>            "@typedef \\1 __not_va_list__;@\n"
> to this ugly thing?  It produces the right thing for my box....

Yuck, let's not make this even less comprehensible than it is now.
Try changing the starred line to

	"s@[ \t]va_list@ __not_va_list__@\n"

Alternatively, change the entire thing to

	// Delete definitions of va_list.
  sed = "/^[ \t]*#[ \t]*define[ \t]*va_list/\n"

	// Delete claims to have defined va_list.
	"/^[ \t]*#[ \t]*define[ \t]*_*VA_LIST/d\n"

	// Change references to va_list to use __gnuc_va_list instead.
	"s/[ \t]va_list/ __gnuc_va_list/";

which should be equivalent except that it doesn't touch _VA_LIST_,
which is probably safe.


More information about the Gcc mailing list