boot2

Playing with the boostrap
git clone https://git.ryansepassi.com/git/boot2.git
Log | Files | Refs | README

029-void-ptr.c (314B)


      1 /* tests/cc-e2e/29-void-ptr.c — void* round-trip cast.
      2  * Split from 01-kitchen-sink. */
      3 
      4 int test_void_ptr(void) {
      5     int x = 99;
      6     void *p = &x;
      7     int *q = (int *)p;
      8     return *q;                      /* 99 */
      9 }
     10 
     11 int main(int argc, char **argv) {
     12     if (test_void_ptr() != 99) return 1;
     13     return 0;
     14 }