]> git.xonotic.org Git - xonotic/gmqcc.git/blobdiff - main.c
Adding truth-flags testsuite for strings
[xonotic/gmqcc.git] / main.c
diff --git a/main.c b/main.c
index 8394df45ec3c3192d9f573b56a7cedd79a2b202a..558edc339ef25b52393176f8fa780592b503482a 100644 (file)
--- a/main.c
+++ b/main.c
@@ -206,8 +206,6 @@ static bool options_parse(int argc, char **argv) {
 
             /* show defaults (like pathscale) */
             if (!strcmp(argv[0]+1, "show-defaults")) {
-                size_t itr;
-                char   buffer[1024];
                 for (itr = 0; itr < COUNT_FLAGS; ++itr) {
                     if (!OPTS_FLAG(itr))
                         continue;
@@ -510,6 +508,11 @@ int main(int argc, char **argv) {
         return usage();
     }
 
+    if (OPTS_FLAG(TRUE_EMPTY_STRINGS) && OPTS_FLAG(FALSE_EMPTY_STRINGS)) {
+        con_err("-ftrue-empty-strings and -ffalse-empty-strings are mutually exclusive");
+        exit(1);
+    }
+
     /* the standard decides which set of operators to use */
     if (opts.standard == COMPILER_GMQCC) {
         operators      = c_operators;
@@ -582,6 +585,9 @@ int main(int argc, char **argv) {
         }
     }
 
+    if (OPTS_FLAG(TRUE_EMPTY_STRINGS))
+        type_not_instr[TYPE_STRING] = INSTR_NOT_F;
+
     util_debug("COM", "starting ...\n");
 
     /* add macros */