]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
gitignore: be more clever
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index f659e4776dd292a5af167644fc9262cd0bbf48c1..2b055d2210f35bf59d556053f366e27c7c12e3d8 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2012
+ * Copyright (C) 2012, 2013
  *     Dale Weiler
  *     Wolfgang Bumiller
  *
@@ -51,6 +51,11 @@ static void version() {
         __DATE__,
         __TIME__
     );
+#ifdef GMQCC_GITINFO
+    con_out("git build: %s\n", GMQCC_GITINFO);
+#elif defined(GMQCC_VERION_TYPE_DEVEL)
+    con_out("development build\n");
+#endif
 }
 
 static int usage() {
@@ -163,6 +168,7 @@ static bool options_parse(int argc, char **argv) {
                     opts_set(opts.flags, FALSE_EMPTY_STRINGS,           false);
                     opts_set(opts.flags, TRUE_EMPTY_STRINGS,            true);
                     opts_set(opts.flags, LOOP_LABELS,                   true);
+                    opts_set(opts.flags, TRANSLATABLE_STRINGS,          true);
                     opts_set(opts.flags, INITIALIZED_NONCONSTANTS,      true);
                     opts_set(opts.werror, WARN_INVALID_PARAMETER_COUNT, true);
                     opts_set(opts.werror, WARN_MISSING_RETURN_VALUES,   true);
@@ -180,8 +186,8 @@ static bool options_parse(int argc, char **argv) {
                     opts_set(opts.flags, TRANSLATABLE_STRINGS,     true);
                     opts_set(opts.flags, ADJUST_VECTOR_FIELDS,     false);
                     opts_set(opts.flags, ASSIGN_FUNCTION_TYPES,    true);
-                    opts_set(opts.warn, WARN_TERNARY_PRECEDENCE,   true);
                     opts_set(opts.flags, CORRECT_TERNARY,          false);
+                    opts_set(opts.warn, WARN_TERNARY_PRECEDENCE,   true);
                     opts.standard = COMPILER_FTEQCC;
 
                 } else if (!strcmp(argarg, "qccx")) {
@@ -342,8 +348,10 @@ static bool options_parse(int argc, char **argv) {
                     else if (!strcmp(argv[0]+2, "ERROR") ||
                              !strcmp(argv[0]+2, "ERROR_ALL"))
                     {
+                        opts_backup_non_Werror_all();
                         for (itr = 0; itr < sizeof(opts.werror)/sizeof(opts.werror[0]); ++itr)
                             opts.werror[itr] = 0xFFFFFFFFL;
+                        opts_restore_non_Werror_all();
                         break;
                     }
                     else if (!strcmp(argv[0]+2, "NONE")) {
@@ -352,8 +360,10 @@ static bool options_parse(int argc, char **argv) {
                         break;
                     }
                     else if (!strcmp(argv[0]+2, "ALL")) {
+                        opts_backup_non_Wall();
                         for (itr = 0; itr < sizeof(opts.warn)/sizeof(opts.warn[0]); ++itr)
                             opts.warn[itr] = 0xFFFFFFFFL;
+                        opts_restore_non_Wall();
                         break;
                     }
                     else if (!strncmp(argv[0]+2, "ERROR_", 6)) {
@@ -455,6 +465,18 @@ static bool options_parse(int argc, char **argv) {
                         opts.quiet = true;
                         break;
                     }
+                    else if (!strcmp(argv[0]+2, "correct")) {
+                        opts.correction = true;
+                        break;
+                    }
+                    else if (!strcmp(argv[0]+2, "no-correct")) {
+                        opts.correction = false;
+                        break;
+                    }
+                    else if (!strcmp(argv[0]+2, "add-info")) {
+                        opts.add_info = true;
+                        break;
+                    }
                     else {
             /* All long options with arguments */
                         if (options_long_witharg("output", &argc, &argv, &argarg)) {
@@ -570,7 +592,7 @@ int main(int argc, char **argv) {
             con_out("Flag %s = %i\n",    opts_flag_list[itr].name, OPTS_FLAG(itr));
         for (itr = 0; itr < COUNT_WARNINGS; ++itr)
             con_out("Warning %s = %i\n", opts_warn_list[itr].name, OPTS_WARN(itr));
-        
+
         con_out("output             = %s\n", opts.output);
         con_out("optimization level = %d\n", opts.O);
         con_out("standard           = %i\n", opts.standard);