title: 64 bit shared memory segment C \ linux problems
body: <p>I'm looking to do some IPC with shared memory segments in C \ Linux.</p>
  
  <p>I go on creating it like normal :</p>
  
  <pre><code>typedef struct {
      int a[2];
  } shm_segment;
  </code></pre>
  
  <p>...</p>
  
  <pre><code>shm_segment *shm;
  
  int shm_id;
  int shm_flags = IPC_CREAT | 0666
  int shm_size = sizeof(struct shm_segment)
  key_t key = 88899;
  shm_id = shmget(key, shm_size, shm_flags); // ies this is in an if for error cheking but for example sake i omitted it
  
  shm = (shm_segment*)shmat(shm_id, (void*)0, 0);
  </code></pre>
  
  <p>Last line is where it breaks, at compile it just gives a : </p>
  
  <pre><code>Warning cast to pointer from integer of a different size.
  </code></pre>
  
  <p>From what I've done before this code works perfectly on 32 bit machines (no warning) (have't tested the exact same code, but the same), but on my 64 bit it gives this warning on compile.</p>
  
  <p>And at run it segfaults. 
  From the research i've done i believe casting from a void* to my pointer messes the pointer up, from 64 bit causes.</p>
  
  <p>Any ideea how i can fix this guys? Or what is causing it?</p>