Description of problem: As per upstream mailing list post here: http://supercolony.gluster.org/pipermail/gluster-devel/2014-August/041888.html Emmanuel Dreyfus wrote: 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. And from further discussion off list: The point is that when there is the need for a cast from pointer to int, uintptr_t should be used, as there is the guarantee that its size fits the pointer size. http://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdint.h.html When displaying such an int, printf("%"PRIxPTR, var); shoud be used http://pubs.opengroup.org/onlinepubs/009695399/basedefs/inttypes.h.html Version-Release number of selected component (if applicable): Upstream GlusterFS git, master branch, as of Monday 11th August 2014.
Further thoughts from Niels de Vos: Justin Clift wrote: > Niels, do you reckon this is an EasyFix candidate? Probably, yes. But please include a way on reproducing the warnings. For example, on can build GlusterFS master on Fedora Rawhide i386 or Fedora armv7hl. If possible, also give an example on how casting is correctly done. A build.log from Fedora Rawhide/i386 contains the same warnings. Search for -Wformat in http://download.gluster.org/pub/gluster/glusterfs/nightly/glusterfs/fedora-rawhide-i386/glusterfs-3.7dev-0.77.gitccb5dc0.autobuild/build.log (attached)
Created attachment 925823 [details] Build log showing the error