Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2001:
[Freeciv-Dev] Re: int -> void*, was Re: [RFC] Attaching information to o
Home

[Freeciv-Dev] Re: int -> void*, was Re: [RFC] Attaching information to o

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxxxx
Cc: freeciv development list <freeciv-dev@xxxxxxxxxxx>
Subject: [Freeciv-Dev] Re: int -> void*, was Re: [RFC] Attaching information to objects
From: David Pfitzner <dwpfitzner@xxxxxxxxx>
Date: Wed, 17 Jan 2001 19:11:00 -0800 (PST)

Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote: 

> On Mon, Jan 15, 2001 at 03:11:08PM -0800, David Pfitzner wrote:

> > Is it guaranteed by the language that stuffing the int into the
> > void* will always work, or does it just happen to work on most
> > (all?) platforms?

> ISO/ANSI C99 added optional types intptr_t and uintptr_t. Pointers
> can be cast to these types and back without loss of information.
> IMHO they are expected to be used in weird places where pointers
> need to be stored together with integers

Well, I don't think Freeciv actually uses/requires C99 features
at this time :-)

Also this sounds like still a different problem, since it talks
of casting pointers to int and back, where we're interested in
casting arbitrary ints to pointers (specifically void*) and back.

-- David

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/



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