[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnu-arch-users] Re: posible issue on ia64 with va_args.
From: |
Jan Hudec |
Subject: |
[Gnu-arch-users] Re: posible issue on ia64 with va_args. |
Date: |
Fri, 12 Mar 2004 10:03:04 +0100 |
User-agent: |
Mutt/1.5.5.1+cvs20040105i |
On Fri, Mar 12, 2004 at 10:47:45 +0900, Miles Bader wrote:
> Jan Hudec <address@hidden> writes:
> > 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.
>
> Even when that relation holds, this particular case can screw you; for
> it to `work', you need sizeof (int) == sizeof (whatever_ptr).
Even than, the spec does not guarantee you are safe.
The spec does not say anything about relation of pointer to integer. It
implies, that (void *)0 == NULL and (int)NULL == 0, but does not say the
memory representation is the same. So you must cast a parameter to be
read as pointer to pointer -- either explicitely (use NULL) or
implicitely (via prototype).
-------------------------------------------------------------------------------
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, 2004/03/11
- [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 <=
- [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