boot2

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

120-redecl-extern-fn.c (357B)


      1 /* Compatible redecl: two identical extern fn prototypes for the same
      2  * function are legal C and common in flattened TUs that pick up the
      3  * same declaration from multiple headers. */
      4 
      5 extern int square(int);
      6 extern int square(int);
      7 
      8 int square(int x) { return x * x; }
      9 
     10 int main(int argc, char **argv) {
     11     if (square(5) != 25) return 1;
     12     return 0;
     13 }