On Fri, Jul 06, 2001 at 04:37:43PM +1000, Peter Jeremy wrote:
> >On i386, 'gcc -fsyntax-only -Wall x.c' produces no error. On
> >NetBSD/alpha (same compiler, really), this produces:
> >
> >x.c: In function `func':
> >x.c:4: warning: cast from pointer to integer of different size
> >
> >It'd be *really* nice if we could add a flag where such errors could be
> >checked for and emitted for an i386 build.
> 
> David would know for certain, but I think this is messy to detect.  As
> I see it, the problem is that when casting a pointer type to an
> integer type, gcc only looks at the lengths of the types - on an i386,
> sizeof(int) == sizeof(long) == sizeof(void *), whereas on an Alpha,
> sizeof(int) != sizeof(long) == sizeof(void *).  Whilst it is possible
> to change the check so that it verifies that the integer type is
> `long' (or longer), this may cause other problems.

Correct.
 
-- 
-- David  ([EMAIL PROTECTED])

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to