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

Re: GCC 4.1 now the default GCC version for etch

On Thu, Jun 08, 2006 at 07:58:23AM +0200, Bastian Blank wrote:
> On Wed, Jun 07, 2006 at 11:53:24PM +0100, Darren Salt wrote:
> > The others are trivially fixable; of these, the one in libavcodec is already
> > fixed in CVS. I've committed the rest (they're basically s/int/long/) and am
> > forwarding them appropriately.
> long is not appropriate to save pointers, you need to use intptr_t or
> uintptr_t.

C90 basically promised it would work, and it is widely considered a
bug in C99 that there is no such guarantee. sizeof(void*) ==
sizeof(long) is also assumed all over the place in Linux, and there is
not a chance in hell that will ever change. The only relevant system
that does not have sizeof(void*) == sizeof(long) is 64-bit windows.

So in summary, if you don't care about portability to 64-bit windows,
assuming sizeof(void*) == sizeof(long) is just fine.


Reply to: