32/64 bits portability

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

 



Hi

I note this kind of warnings:

meta-helpers.c:42:13: warning: cast to pointer from integer of different
size
meta-helpers.c: In function 'meta_fd_release':

This is caused by the attempt to use uint64_t as a placeholder for
pointers. That causes warnings on machines with 32 bit pointers, and of
course you are doomed the day pointers get bigger than 64 bits (not for
tomorrow, but we all know computers do not need more than 640 kB,
right?)

uintptr_t is the right type to use in such a situation. POSIX defines it
as an unsigned integer capable of holding a pointer. <stdint.h> takes
care of defining it to the right size:
http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html

Fixing this warning in meta-helpers.c means modifying libglusterfs
interfaces and cause a widespread change, hence I will not submit it,
but I just share that information in case some courageous developer want
to give it a try for the sake of portability.

-- 
Emmanuel Dreyfus
http://hcpnet.free.fr/pubz
manu@xxxxxxxxxx
_______________________________________________
Gluster-devel mailing list
Gluster-devel@xxxxxxxxxxx
http://supercolony.gluster.org/mailman/listinfo/gluster-devel




[Index of Archives]     [Gluster Users]     [Ceph Users]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux