Accept -Wno-all, -Wno-extra and -Wno-unused like GCC.
[cparser] / lexer.c
diff --git a/lexer.c b/lexer.c
index b00b8a2..7c61082 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -11,6 +11,7 @@
 #include "type_t.h"
 #include "target_architecture.h"
 #include "parser.h"
+#include "warning.h"
 
 #include <assert.h>
 #include <errno.h>
@@ -95,11 +96,11 @@ static inline void next_char(void);
                        next_char();                      \
                }                                     \
                lexer_token.source_position.linenr++; \
-               code;                                 \
+               code                                  \
        case '\n':                                \
                next_char();                          \
                lexer_token.source_position.linenr++; \
-               code;
+               code
 
 #define eat(c_type)  do { assert(c == c_type); next_char(); } while(0)
 
@@ -1037,7 +1038,9 @@ static void parse_preprocessor_identifier(void)
                error_directive();
                break;
        case TP_pragma:
-               warningf(lexer_token.source_position, "encountered unknown #pragma");
+               if (warning.unknown_pragmas) {
+                       warningf(lexer_token.source_position, "encountered unknown #pragma");
+               }
                eat_until_newline();
                break;
        }