Created
January 3, 2011 22:50
-
-
Save niklas/764119 to your computer and use it in GitHub Desktop.
trying to find out if ruby 1.9.2 does not implement syscall() on amd64 because of the different sizes if int and long
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
please do me a favour: do the following on a amd64 ubuntu | |
$ gcc -o sizeof64 sizeof64.c | |
$ ./sizeof64 | |
are they different? would this be OK? If not, what could cause this? | |
If it is OK, why is ruby 1.9 not able to implement syscall() | |
https://github.com/ruby/ruby/blob/ruby_1_9_2/io.c#L7529 | |
It's long time since I coded C so please forgive my missing -wall | |
*/ | |
#include <stdio.h> | |
main() { | |
static int an_int = 23; | |
static long a_long = 23; | |
printf("size of int: %i\n", (int) sizeof((an_int)) ); | |
printf("size of long: %i\n", (int) sizeof((a_long)) ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
martin@neolith:/tmp$ ./sizeof64
size of int: 4
size of long: 8