prs_uint32 applied to pointers?

Mikhail T. mi+metlife at aldan.algebra.com
Wed May 16 19:24:58 GMT 2007


Hello!

Trying to build Samba on my FreeBSD/amd64 machine, I noticed a scary 
warning about a pointer getting cast to an integer of lesser width.

Indeed, the following code seems to stick the file path /pointer/ into a 
32-bit number:

        uni_p = fl3->path ? (uint32)fl3->path : 0;
        if(!prs_uint32("ptr", ps, depth, &uni_p))
                return False;

Although the 32-bit systems will not notice, the code does not seem 
right for 64-bit ones, where pointers are 64-bit wide. Can someone, 
please, comment? Silencing the warning is easy, but there may be a 
genuine problem pointed out here.

The file in question is samba-3.0.25rc3/source/rpc_parse/parse_srv.c.

Thanks!

    -mi


More information about the samba-technical mailing list