No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
MS compiler is usually good about giving these kind warnings from what I hear. I guess this is a situation it misses.
Aside from printf formatting differences, yes.
Your code uses & 0x3. That's 2 bits. I take it that's a bug.
That's normally handled by a configuration script. It's not just based on the size of the pointers, but on the compiler's definition of "unsigned long" and such. stdint.h provides uintptr_t, but not the others. If this is XS code, Perl providers similar tools for you already. The code is now:
$ gcc -Wall -m64 -o a a.c && a a.c: In function ‘check_new’: a.c:38: warning: '0' flag used with ‘%p’ printf format a.c:38: warning: '0' flag used with ‘%p’ printf format address: 0x0000000001e240 slot: (nil) byte: 3c4 bit: 4 nop: 0 address: 0x0000002001e240 slot: 0x00000000000100 byte: 3c4 bit: 4 nop: 0 address: 0x0000004001e240 slot: 0x00000000000200 byte: 3c4 bit: 4 nop: 0 address: 0x0000006001e240 slot: 0x00000000000300 byte: 3c4 bit: 4 nop: 0 address: 0x0000008001e240 slot: 0x00000000000400 byte: 3c4 bit: 4 nop: 0 address: 0x000000a001e240 slot: 0x00000000000500 byte: 3c4 bit: 4 nop: 0 address: 0x000000c001e240 slot: 0x00000000000600 byte: 3c4 bit: 4 nop: 0 address: 0x000000e001e240 slot: 0x00000000000700 byte: 3c4 bit: 4 nop: 0 address: 0x0000010001e240 slot: 0x00000000000800 byte: 3c4 bit: 4 nop: 0 address: 0x0000012001e240 slot: 0x00000000000900 byte: 3c4 bit: 4 nop: 0 address: 0x0000014001e240 slot: 0x00000000000a00 byte: 3c4 bit: 4 nop: 0 address: 0x0000016001e240 slot: 0x00000000000b00 byte: 3c4 bit: 4 nop: 0 address: 0x0000018001e240 slot: 0x00000000000c00 byte: 3c4 bit: 4 nop: 0 address: 0x000001a001e240 slot: 0x00000000000d00 byte: 3c4 bit: 4 nop: 0 address: 0x000001c001e240 slot: 0x00000000000e00 byte: 3c4 bit: 4 nop: 0 address: 0x000001e001e240 slot: 0x00000000000f00 byte: 3c4 bit: 4 nop: 0 address: 0x0000020001e240 slot: 0x00000000001000 byte: 3c4 bit: 4 nop: 0 address: 0x0000022001e240 slot: 0x00000000001100 byte: 3c4 bit: 4 nop: 0 address: 0x0000024001e240 slot: 0x00000000001200 byte: 3c4 bit: 4 nop: 0 address: 0x0000026001e240 slot: 0x00000000001300 byte: 3c4 bit: 4 nop: 0 address: 0x0000028001e240 slot: 0x00000000001400 byte: 3c4 bit: 4 nop: 0 address: 0x000002a001e240 slot: 0x00000000001500 byte: 3c4 bit: 4 nop: 0 address: 0x000002c001e240 slot: 0x00000000001600 byte: 3c4 bit: 4 nop: 0 address: 0x000002e001e240 slot: 0x00000000001700 byte: 3c4 bit: 4 nop: 0 address: 0x0000030001e240 slot: 0x00000000001800 byte: 3c4 bit: 4 nop: 0 address: 0x0000032001e240 slot: 0x00000000001900 byte: 3c4 bit: 4 nop: 0 address: 0x0000034001e240 slot: 0x00000000001a00 byte: 3c4 bit: 4 nop: 0 address: 0x0000036001e240 slot: 0x00000000001b00 byte: 3c4 bit: 4 nop: 0 address: 0x0000038001e240 slot: 0x00000000001c00 byte: 3c4 bit: 4 nop: 0 address: 0x000003a001e240 slot: 0x00000000001d00 byte: 3c4 bit: 4 nop: 0 address: 0x000003c001e240 slot: 0x00000000001e00 byte: 3c4 bit: 4 nop: 0 address: 0x000003e001e240 slot: 0x00000000001f00 byte: 3c4 bit: 4 nop: 0 Update: I couldn't get UINTPTR_C and UINTPTRxf configured automatically. I initially tried to use sizeof in conditional pre-processor directives (as shown below), but that's not allowed. Fixed.
In reply to Re^3: 64-bit *nix/gcc expertise required
by ikegami
|
|