boot2

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

00189.c (418B)


      1 #include <stdio.h>
      2 
      3 int fred(int p)
      4 {
      5    printf("yo %d\n", p);
      6    return 42;
      7 }
      8 
      9 int (*f)(int) = &fred;
     10 
     11 /* To test what this is supposed to test the destination function
     12    (fprint here) must not be called directly anywhere in the test.  */
     13 int (*fprintfptr)(FILE *, const char *, ...) = &fprintf;
     14 
     15 int main()
     16 {
     17    fprintfptr(stdout, "%d\n", (*f)(24));
     18 
     19    return 0;
     20 }
     21 
     22 /* vim: set expandtab ts=4 sw=3 sts=3 tw=80 :*/