[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: |
Jan Hudec |
Subject: |
Re: [Gnu-arch-users] posible issue on ia64 with va_args. |
Date: |
Wed, 10 Mar 2004 11:57:51 +0100 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
On Sat, Mar 06, 2004 at 18:35:43 +1100, Robert Collins wrote:
> 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.
>
> 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?
Acoording to my knowledge noone ever guaranteed that passing 0 instead
of NULL is going to work. In fact, it's probably a bug to do so.
(It _is_ going to work for comparsion and it _is_ going to work when
prototype is known, however)
IIRC it's only specified, that any type shorter than integer will be
promoted to size of integer. And NO relation between sizeof(int),
sizeof(long) and sizeof(void *) is claimed by specification whatsoever!
It is known to hold on all widely used platforms that sizeof(int) <=
sizeof(void *) <= sizeof(long), but no stricter relation holds.
-------------------------------------------------------------------------------
Jan 'Bulb' Hudec
<address@hidden>
signature.asc
Description: Digital signature
- [Gnu-arch-users] posible issue on ia64 with va_args., Robert Collins, 2004/03/10
- Re: [Gnu-arch-users] posible issue on ia64 with va_args., Tom Lord, 2004/03/11
- [Gnu-arch-users] Re: posible issue on ia64 with va_args., Miles Bader, 2004/03/11
- Re: [Gnu-arch-users] posible issue on ia64 with va_args., Andrew Suffield, 2004/03/11
- Re: [Gnu-arch-users] posible issue on ia64 with va_args.,
Jan Hudec <=
- [Gnu-arch-users] Re: posible issue on ia64 with va_args., Miles Bader, 2004/03/12
- [Gnu-arch-users] Re: posible issue on ia64 with va_args., Jan Hudec, 2004/03/12
- [Gnu-arch-users] Re: posible issue on ia64 with va_args., Miles Bader, 2004/03/12
- Re: [Gnu-arch-users] Re: posible issue on ia64 with va_args., Andrew Suffield, 2004/03/16
- [Gnu-arch-users] Re: posible issue on ia64 with va_args., Stefan Monnier, 2004/03/16
- Re: [Gnu-arch-users] Re: posible issue on ia64 with va_args., Andrew Suffield, 2004/03/18
- Re: [Gnu-arch-users] Re: posible issue on ia64 with va_args., Jan Hudec, 2004/03/18