]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Cleanups and make compile with clang again with no warnings.
authorDale Weiler <killfieldengine@gmail.com>
Sat, 22 Dec 2012 08:22:50 +0000 (08:22 +0000)
committerDale Weiler <killfieldengine@gmail.com>
Sat, 22 Dec 2012 08:22:50 +0000 (08:22 +0000)
Makefile
ast.c
exec.c
main.c
parser.c
test.c

index eae6f3e65860d859a1f9380119835ca2625d2347..0d1cee7025918aca55abc5311559c46f23a88a7a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,7 +19,9 @@ ifeq ($(CC), clang)
                -Wno-format-nonliteral        \
                -Wno-disabled-macro-expansion \
                -Wno-conversion               \
-               -Wno-missing-prototypes
+               -Wno-missing-prototypes       \
+               -Wno-float-equal              \
+               -Wno-cast-align
 endif
 ifeq ($(track), no)
     CFLAGS += -DNOTRACK
diff --git a/ast.c b/ast.c
index 23ed28ab12c74b6a7be67f1bc5fcf4911c07eec5..e544e48a24984edd9e6176bec0afe3297d84a324 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -1085,7 +1085,6 @@ void _ast_codegen_output_type(ast_expression_common *self, ir_value *out)
 }
 
 #define codegen_output_type(a,o) (_ast_codegen_output_type(&((a)->expression),(o)))
-#define codegen_output_type_expr(a,o) (_ast_codegen_output_type(a,(o)))
 
 bool ast_value_codegen(ast_value *self, ast_function *func, bool lvalue, ir_value **out)
 {
diff --git a/exec.c b/exec.c
index aaaa88b3b830fe9737c9fe7433ec36f9a186a3e4..f4a986ed8e6cb2e2def9b3ac73086070e8c5cc9f 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -560,28 +560,24 @@ bool prog_exec(qc_program *prog, prog_section_function *func, size_t flags, long
 #define QCVM_PROFILE 0
 #define QCVM_TRACE   0
 #           include __FILE__
-            break;
         }
         case (VMXF_TRACE):
         {
 #define QCVM_PROFILE 0
 #define QCVM_TRACE   1
 #           include __FILE__
-            break;
         }
         case (VMXF_PROFILE):
         {
 #define QCVM_PROFILE 1
 #define QCVM_TRACE   0
 #           include __FILE__
-            break;
         }
         case (VMXF_TRACE|VMXF_PROFILE):
         {
 #define QCVM_PROFILE 1
 #define QCVM_TRACE   1
 #           include __FILE__
-            break;
         }
     };
 
diff --git a/main.c b/main.c
index aaa61c31c0d2e8dfde2785465fa9318e2df52342..d6edd5cbf46fe9ed9b1aad9d19a07407259fb7d2 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;
index 9955058360ad5d842fa91757e85955f5327a9c93..d64741543f25c6133d0f18c49c50b3b3b40c4986 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -26,8 +26,6 @@
 #include "gmqcc.h"
 #include "lexer.h"
 
-#define PARSER_HT_FIELDS  0
-#define PARSER_HT_GLOBALS 1
 /* beginning of locals */
 #define PARSER_HT_LOCALS  2
 
@@ -4375,7 +4373,6 @@ skipvar:
         }
         else if (parser->tok == '{' || parser->tok == '[')
         {
-            size_t i;
             if (localblock) {
                 parseerror(parser, "cannot declare functions within functions");
                 break;
diff --git a/test.c b/test.c
index 1a12f078043a7070b3c1b281a910e11acd0270b6..b29a3d4c1b1a7ca9176ed89f1d60128cf43571b2 100644 (file)
--- a/test.c
+++ b/test.c
@@ -127,8 +127,21 @@ FILE ** task_popen(const char *command, const char *mode) {
         goto task_popen_error_3;
     }
 
+    /*
+     * clang is stupid, it doesn't understand that yes, this code
+     * is actually reachable.
+     */
+#   ifdef __clang__
+#       pragma clang diagnostic push
+#       pragma clang diagnostic ignored "-Wunreachable-code"
+#   endif
     if (argv)
         vec_free(argv);
+
+#   ifdef __clang__
+#    pragma clang diagnostic pop
+#   endif
+
     return data->handles;
 
 task_popen_error_3: close(errhandle[0]), close(errhandle[1]);