Extra headers and casts so it can compile with the -ansi flag

This commit is contained in:
Michael Martin 2016-01-24 15:56:45 -08:00
parent d2d8ab6bfc
commit 877c4bfacc
3 changed files with 11 additions and 2 deletions

View File

@ -3,6 +3,8 @@
#include "macrossTypes.h"
#include <stdarg.h>
void puntOnError(errorType theError, ...);
void printErrorMessage(errorType theError, va_list ap);
void error(errorType theError, ...);

View File

@ -3,6 +3,8 @@
#include "macrossTypes.h"
#include <stdarg.h>
void outputListing(void);
void terminateListingFiles(void);
void generateListing(void);

9
main.c
View File

@ -48,9 +48,14 @@ main(int argc, char **argv)
initializeStuff(argc, argv);
yyparse();
finishUp();
/* sbrk() ends up having different signatures depending on compiler
* flags and system. We cast here out of an abundance of caution.
* This, and the "end" variable above, are both just for this one
* diagnostic, so if they're causing your build trouble, they can
* be safely deleted. --mcm */
if (emitPrint)
printf("storage high water mark 0x%x == %d\n", sbrk(0) - (void *)(&end),
sbrk(0) - (void *)(&end));
printf("storage high water mark 0x%x == %d\n", (void *)sbrk(0) - (void *)(&end),
(void *)sbrk(0) - (void *)(&end));
if (errorFlag)
chokePukeAndDie();
return 0;