mechgyver
07-06-07, 10:58 AM
Has anyone had any success compiling Pete Gray's Small C compiler source code using terminal and gcc on an Intel Mac running OS X 10.4.10?
For example, I have been trying the following compile command:
gcc -o cc1.o cc1.c
However, I just get a huge list of errors:
cc1.c: In function 'getarg':
cc1.c:17: warning: assignment makes integer from pointer without a cast
cc1.c:21: warning: assignment makes pointer from integer without a cast
cc1.c:23: warning: comparison between pointer and integer
cc1.c:26: warning: assignment makes integer from pointer without a cast
cc1.c: In function 'main':
cc1.c:130: warning: incompatible implicit declaration of built-in function 'calloc'
cc1.c:152: warning: passing argument 1 of 'fclose' makes pointer from integer without a cast
cc1.c: In function 'doinclude':
cc1.c:291: warning: assignment makes integer from pointer without a cast
cc1.c:292: warning: assignment makes integer from pointer without a cast
cc1.c:292: warning: comparison between pointer and integer
cc1.c: In function 'dodefine':
cc1.c:323: warning: incompatible implicit declaration of built-in function 'abort'
cc1.c:323: error: too many arguments to function 'abort'
cc1.c: In function 'dofunction':
cc1.c:360: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'doargs':
cc1.c:422: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'compound':
cc1.c:543: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'addlabel':
cc1.c:696: warning: assignment makes pointer from integer without a cast
cc1.c:703: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'dobreak':
cc1.c:717: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'docont':
cc1.c:729: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'doasm':
cc1.c:745: warning: passing argument 2 of 'fputs' makes pointer from integer without a cast
cc1.c: In function 'ask':
cc1.c:773: warning: assignment makes integer from pointer without a cast
cc1.c:798: warning: incompatible implicit declaration of built-in function 'abort'
cc1.c:798: error: too many arguments to function 'abort'
cc1.c: In function 'openfile':
cc1.c:821: warning: incompatible implicit declaration of built-in function 'strcpy'
cc1.c:833: warning: assignment makes integer from pointer without a cast
cc1.c: In function 'mustopen':
cc1.c:842: warning: assignment makes integer from pointer without a cast
cc1.c:845: warning: incompatible implicit declaration of built-in function 'abort'
cc1.c:845: error: too many arguments to function 'abort'
Any help or advice would be greatly appreciated!
Thanks!
For example, I have been trying the following compile command:
gcc -o cc1.o cc1.c
However, I just get a huge list of errors:
cc1.c: In function 'getarg':
cc1.c:17: warning: assignment makes integer from pointer without a cast
cc1.c:21: warning: assignment makes pointer from integer without a cast
cc1.c:23: warning: comparison between pointer and integer
cc1.c:26: warning: assignment makes integer from pointer without a cast
cc1.c: In function 'main':
cc1.c:130: warning: incompatible implicit declaration of built-in function 'calloc'
cc1.c:152: warning: passing argument 1 of 'fclose' makes pointer from integer without a cast
cc1.c: In function 'doinclude':
cc1.c:291: warning: assignment makes integer from pointer without a cast
cc1.c:292: warning: assignment makes integer from pointer without a cast
cc1.c:292: warning: comparison between pointer and integer
cc1.c: In function 'dodefine':
cc1.c:323: warning: incompatible implicit declaration of built-in function 'abort'
cc1.c:323: error: too many arguments to function 'abort'
cc1.c: In function 'dofunction':
cc1.c:360: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'doargs':
cc1.c:422: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'compound':
cc1.c:543: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'addlabel':
cc1.c:696: warning: assignment makes pointer from integer without a cast
cc1.c:703: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'dobreak':
cc1.c:717: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'docont':
cc1.c:729: warning: assignment makes pointer from integer without a cast
cc1.c: In function 'doasm':
cc1.c:745: warning: passing argument 2 of 'fputs' makes pointer from integer without a cast
cc1.c: In function 'ask':
cc1.c:773: warning: assignment makes integer from pointer without a cast
cc1.c:798: warning: incompatible implicit declaration of built-in function 'abort'
cc1.c:798: error: too many arguments to function 'abort'
cc1.c: In function 'openfile':
cc1.c:821: warning: incompatible implicit declaration of built-in function 'strcpy'
cc1.c:833: warning: assignment makes integer from pointer without a cast
cc1.c: In function 'mustopen':
cc1.c:842: warning: assignment makes integer from pointer without a cast
cc1.c:845: warning: incompatible implicit declaration of built-in function 'abort'
cc1.c:845: error: too many arguments to function 'abort'
Any help or advice would be greatly appreciated!
Thanks!