[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] posible issue on ia64 with va_args.

From: Tom Lord
Subject: Re: [Gnu-arch-users] posible issue on ia64 with va_args.
Date: Wed, 10 Mar 2004 02:07:56 -0800 (PST)

    > From: Robert Collins <address@hidden>

    > I've found a problem with gcc 3.0.4 (and possibly newer versions)with
    > the use of '0' to terminate the arch_call_cmd var_args.

I think it's actually with the binary standards on the effected
platforms -- not with GCC per se.

    > the problem is with promotion:
    > u_char * is not promoted at all according to my va_arg info pages. But
    > '0' is being promoted incorrectly, and when accessed by va_arg(ap, char
    > *) results in a 0x60000000000 value. (I think I have the right number of
    > 0's there) :}.

    > Passing 0L as the terminator, or (t_uchar *)0, or NULL works.

    > Anyone care to comment?

Replace the 0 with a defined constant and, to your list of coding
conventions to check for when reviewing code, add that varargs
functions needing an arg-list terminator should use a defined
constants and that that constant should be defined to be of a suitable

"Everything is a VAX",

reply via email to

[Prev in Thread] Current Thread [Next in Thread]