]> git.xonotic.org Git - xonotic/gmqcc.git/commitdiff
Removed even more warnings
authorDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 15:09:29 +0000 (11:09 -0400)
committerDale Weiler <killfieldengine@gmail.com>
Thu, 7 Jun 2012 15:09:29 +0000 (11:09 -0400)
Makefile
asm.c
ast.c
gmqcc.h
main.c

index 4090ab4315f49b7861bcdaa1fd658943ed1a20f6..fe0f5fc3ff5b3b08b60fb091f7739b20ae50762a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -15,8 +15,6 @@ ifeq ($(CC), clang)
                -Wno-padded \
                -Wno-undef \
                -Wno-conditional-uninitialized \
-               -Wno-missing-noreturn \
-               -Wno-ignored-qualifiers \
                -Wno-format-nonliteral
 
 endif
diff --git a/asm.c b/asm.c
index afb155c58a08f5e0f811440e78007687a5e9390b..c73f25cf7956b4121a6f5e2c6c6088ef8a2991db 100644 (file)
--- a/asm.c
+++ b/asm.c
@@ -44,7 +44,7 @@ VECTOR_MAKE(asm_sym, asm_symbols);
  * Assembly text processing: this handles the internal collection
  * of text to allow parsing and assemblation.
  */
-static char *const asm_getline(size_t *byte, FILE *fp) {
+static char* asm_getline(size_t *byte, FILE *fp) {
     char   *line = NULL;
     size_t  read = util_getline(&line, byte, fp);
     *byte = read;
diff --git a/ast.c b/ast.c
index 00ab6117c407a34044dc817bb3f7b6fa81a297ee..acffbdc442fe1108303186087e44d63bffec252c 100644 (file)
--- a/ast.c
+++ b/ast.c
@@ -36,7 +36,7 @@
     ( (ast_node*)self )->node.destroy = (ast_node_delete*)destroyfn
 
 /* It must not be possible to get here. */
-static void _ast_node_destroy(ast_node *self)
+static GMQCC_NORETURN void _ast_node_destroy(ast_node *self)
 {
     fprintf(stderr, "ast node missing destroy()\n");
     abort();
diff --git a/gmqcc.h b/gmqcc.h
index 27597f44e57ead514b892c17f9de6ccb5714e6f0..78acf4a50bf9146cee47a972cbca3b62ae27ce90 100644 (file)
--- a/gmqcc.h
+++ b/gmqcc.h
 #   define GMQCC_INLINE inline
 #endif
 
+/*
+ * noreturn is present in GCC and clang
+ * it's required for _ast_node_destory otherwise -Wmissing-noreturn
+ * in clang complains about there being no return since abort() is
+ * called.
+ */
+#if (defined(__GNUC__) && __GNUC__ >= 2) || defined(__CLANG__)
+#    define GMQCC_NORETURN __attribute__ ((noreturn))
+#else
+#    define GMQCC_NORETURN
+#endif
+
 /*
  * stdint.h and inttypes.h -less subset
  * for systems that don't have it, which we must
diff --git a/main.c b/main.c
index fe2f42690cde09083e524071ffe9490c8f5966ff..1ffcd998927a437459041cd79a53195b72a38465 100644 (file)
--- a/main.c
+++ b/main.c
@@ -24,7 +24,7 @@
 typedef struct { char *name, type; } argitem;
 VECTOR_MAKE(argitem, items);
 
-static const int usage(const char *const app) {
+static int usage(const char *app) {
     printf("usage:\n"
            "    %s -c<file>          -oprog.dat -- compile file\n"
            "    %s -a<file>          -oprog.dat -- assemble file\n"