X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2FSDCCmain.c;h=aa1e5e4636367e78bca44a73ba8d9da4a3db50e6;hb=60c7254a378af70bb45e47881bfd0c02fc75c51b;hp=2fec363daafdde6840cb4a99f0f2f7bfa853ec83;hpb=11f029a039dd3f91dd9c106d8a738fcb794769a6;p=fw%2Fsdcc diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 2fec363d..aa1e5e46 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -120,6 +120,7 @@ char buffer[PATH_MAX * 2]; #define OPTION_NO_LOOP_IND "--noinduction" #define OPTION_LESS_PEDANTIC "--less-pedantic" #define OPTION_DISABLE_WARNING "--disable-warning" +#define OPTION_WERROR "--Werror" #define OPTION_NO_GCSE "--nogcse" #define OPTION_SHORT_IS_8BITS "--short-is-8bits" #define OPTION_NO_XINIT_OPT "--no-xinit-opt" @@ -167,6 +168,7 @@ optionsTable[] = { { 0, "--nostdinc", &options.nostdinc, "Do not include the standard include directory in the search path" }, { 0, OPTION_LESS_PEDANTIC, NULL, "Disable some of the more pedantic warnings" }, { 0, OPTION_DISABLE_WARNING, NULL, " Disable specific warning" }, + { 0, OPTION_WERROR, NULL, "Treat the warnings as errors" }, { 0, "--debug", &options.debug, "Enable debugging symbol output" }, { 0, "--cyclomatic", &options.cyclomatic, "Display complexity of compiled functions" }, { 0, OPTION_STD_C89, NULL, "Use C89 standard only" }, @@ -424,21 +426,8 @@ printVersionInfo (FILE *stream) #ifdef SDCC_SUB_VERSION_STR "/" SDCC_SUB_VERSION_STR #endif - " #%s (" __DATE__ ")" -#ifdef __CYGWIN__ - " (CYGWIN)\n" -#elif defined __MINGW32__ - " (MINGW32)\n" -#elif defined __DJGPP__ - " (DJGPP)\n" -#elif defined(_MSC_VER) - " (MSVC)\n" -#elif defined(__BORLANDC__) - " (BORLANDC)\n" -#else - " (UNIX)\n" -#endif - , getBuildNumber() ); + " #%s (" __DATE__ ") (%s)\n", + getBuildNumber(), getBuildEnvironment() ); } static void @@ -1050,6 +1039,13 @@ parseCmdLine (int argc, char **argv) continue; } + if (strcmp (argv[i], OPTION_WERROR) == 0) + { + setWError(1); + addSet(&preArgvSet, Safe_strdup("-Werror")); + continue; + } + if (strcmp (&argv[i][1], OPTION_SHORT_IS_8BITS) == 0) { options.shortis8bits=1;