1 #include <stdio.h> 2 3 #ifdef PROTOTYPES 4 int callee (int x) 5 #else 6 int callee( x ) 7 int x; 8 #endif 9 { 10 int y = x * x; 11 return (y - 2); 12 } 13 14 int main() 15 { 16 int i; 17 for (i = 1; i < 10; i++) 18 { 19 printf( "%d ", callee( i )); 20 21 } 22 printf( " Goodbye!\n" ); 23 return 0; 24 } 25 /* This routine exists only for aCC. The way we compile this test is 26 that we use aCC for the actual compile into the object file but then 27 use ld directly for the link. When we do this, we get an undefined 28 symbol _main(). Therefore, for aCC, we have this routine in here and 29 ld is happy. */ 30 31 #ifdef __cplusplus 32 extern "C" { 33 void _main() 34 { 35 } 36 } 37 #endif 38