preprocessor: backslash is not a punctuator token
[cparser] / preprocessor.c
index f9cc49b..92d4f37 100644 (file)
@@ -1024,7 +1024,6 @@ restart:
        case '~':
        case ';':
        case ',':
-       case '\\':
                pp_token.kind = input.c;
                next_char();
                return;
@@ -1340,16 +1339,16 @@ static void parse_undef_directive(void)
        eat_pp_directive();
 }
 
+/** behind an #include we can have the special headername lexems.
+ * They're only allowed behind an #include so they're not recognized
+ * by the normal next_preprocessing_token. We handle them as a special
+ * exception here */
 static void parse_headername(void)
 {
        const source_position_t start_position = input.position;
        string_t                string         = { NULL, 0, STRING_ENCODING_CHAR };
        assert(obstack_object_size(&symbol_obstack) == 0);
 
-       /* behind an #include we can have the special headername lexems.
-        * They're only allowed behind an #include so they're not recognized
-        * by the normal next_preprocessing_token. We handle them as a special
-        * exception here */
        if (info.at_line_begin) {
                parse_error("expected headername after #include");
                goto finish_error;
@@ -1556,7 +1555,7 @@ static void parse_ifdef_ifndef_directive(void)
                condition = true;
        } else {
                /* evaluate wether we are in true or false case */
-               condition = !pp_token.base.symbol->pp_definition == is_ifndef;
+               condition = (bool)!pp_token.base.symbol->pp_definition == is_ifndef;
 
                next_preprocessing_token();
 
@@ -1597,7 +1596,7 @@ static void parse_else_directive(void)
        if (conditional->in_else) {
                errorf(&pp_token.base.source_position,
                       "#else after #else (condition started %P)",
-                      conditional->source_position);
+                      &conditional->source_position);
                skip_mode = true;
                return;
        }