in reply to Re^2: Perl XS portable uint32_t
in thread Perl XS portable uint32_t
Maybe this behaviour is not reliable across the full range of compilers/systems/architectures. (I honestly wouldn't know.)use warnings; use Inline C => Config => BUILD_NOISY => 1; use Inline C => <<'EOC'; void foo() { unsigned long x = 0xffffffff; printf("long: %d\nint: %d\n", sizeof(long), sizeof(int)); printf("%x\n", x); x <<= 2; printf("%x\n", x); x >>= 2; printf("%x\n", x); } EOC foo(); __END__ Outputs: long: 4 int: 4 ffffffff fffffffc 3fffffff
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl XS portable uint32_t
by tachyon-II (Chaplain) on Jun 06, 2008 at 15:30 UTC | |
by syphilis (Archbishop) on Jun 06, 2008 at 22:30 UTC |