fix a few warnings reported by cparser
authorMatthias Braun <matze@braunis.de>
Thu, 14 Jul 2011 08:27:07 +0000 (10:27 +0200)
committerMatthias Braun <matze@braunis.de>
Thu, 14 Jul 2011 08:27:07 +0000 (10:27 +0200)
diagnostic.c
parser.c

index b2ba266..af15aa4 100644 (file)
@@ -246,7 +246,7 @@ void warningf(warning_t const warn, source_position_t const* pos, char const *co
        va_list ap;
        va_start(ap, fmt);
        warning_switch_t const *const s = get_warn_switch(warn);
-       switch (s->state) {
+       switch ((unsigned) s->state) {
                        char const* kind;
                case WARN_STATE_ON:
                        if (is_warn_on(WARN_ERROR)) {
index d798e04..5ed7914 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -121,6 +121,7 @@ static elf_visibility_tag_t default_visibility = ELF_VISIBILITY_DEFAULT;
 #define POP_SCOPE() (assert(current_scope == new_scope), scope_pop(old_scope), environment_pop_to(top))
 
 #define PUSH_EXTENSION() \
+       (void)0; \
        bool const old_gcc_extension = in_gcc_extension; \
        while (next_if(T___extension__)) { \
                in_gcc_extension = true; \
@@ -10404,7 +10405,7 @@ static void parse_external(void)
                case '&':  /* & x; -> int& x; (and error later, because C++ has no
                              implicit int) */
                case '*':  /* * x; -> int* x; */
-               case '(':; /* (x); -> int (x); */
+               case '(':  /* (x); -> int (x); */
                                PUSH_EXTENSION();
                                parse_external_declaration();
                                POP_EXTENSION();