From 877c4bfacc5b5ab29270995ea0d1d1e6cc086c50 Mon Sep 17 00:00:00 2001 From: Michael Martin Date: Sun, 24 Jan 2016 15:56:45 -0800 Subject: [PATCH] Extra headers and casts so it can compile with the -ansi flag --- errorStuff.h | 2 ++ listing.h | 2 ++ main.c | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/errorStuff.h b/errorStuff.h index 8605c5f..5b94cbe 100644 --- a/errorStuff.h +++ b/errorStuff.h @@ -3,6 +3,8 @@ #include "macrossTypes.h" +#include + void puntOnError(errorType theError, ...); void printErrorMessage(errorType theError, va_list ap); void error(errorType theError, ...); diff --git a/listing.h b/listing.h index 2512d4a..181e5de 100644 --- a/listing.h +++ b/listing.h @@ -3,6 +3,8 @@ #include "macrossTypes.h" +#include + void outputListing(void); void terminateListingFiles(void); void generateListing(void); diff --git a/main.c b/main.c index 7226ecb..f050847 100644 --- a/main.c +++ b/main.c @@ -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;