Re: int problems on amd64



On Tue, Mar 29, 2005 at 05:28:35PM +0200, Fabio Rotondo wrote:
Roland Smith wrote:

I'm using GTK+ on FreeBSD 5.3 amd64 without problems. Any program
casting int to void* is b0rken.

you are perfectly right, but suppose you have to write a qsort callback:

void qsort(void *base, size_t nmemb, size_t size, int(*compar)(const
void *, const void *));

suppose the "const void *" is actually an int value. By downcasting it
to int, gcc gives you a warning.

You could try using the 'mode' __attribute__ on the integers?

I don't think using setjmp and longjmp on GTK+ is such a good idea. 

longjmp()  and  setjmp()  are  useful  for  dealing  with  errors  and
interrupts encountered in a low-level subroutine of a program.
We have implemented an exception-like environment in standard C so we
need them.

At least don't use them in signal handlers. See:
http://www.mail-archive.com/gtk-list gnome org/msg04340.html

Roland
-- 
R.F. Smith                           /"\    ASCII Ribbon Campaign
r s m i t h @ x s 4 a l l . n l      \ /    No HTML/RTF in e-mail
http://www.xs4all.nl/~rsmith/         X     No Word docs in e-mail
public key: http://www.keyserver.net / \    Respect for open standards


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