- fixed source position of binary expressions
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 15 Dec 2007 03:07:35 +0000 (03:07 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Sat, 15 Dec 2007 03:07:35 +0000 (03:07 +0000)
- added initialization for -Wunused-label
- switched some warnings off by default

[r18760]

parser.c
warning.c

index c769d34..10fd845 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -3519,6 +3519,7 @@ static expression_t *parse_compare_builtin(void)
                panic("invalid compare builtin found");
                break;
        }
+       expression->base.source_position = HERE;
        next_token();
 
        expect('(');
@@ -3535,7 +3536,7 @@ static expression_t *parse_compare_builtin(void)
        if(!is_type_floating(type_left) && !is_type_floating(type_right)) {
                if (is_type_valid(type_left) && is_type_valid(type_right)) {
                        type_error_incompatible("invalid operands in comparison",
-                               token.source_position, orig_type_left, orig_type_right);
+                               expression->base.source_position, orig_type_left, orig_type_right);
                }
        } else {
                semantic_comparison(&expression->binary);
@@ -4635,10 +4636,12 @@ static expression_t *parse_##binexpression_type(unsigned precedence,      \
                                                 expression_t *left)       \
 {                                                                         \
        eat(token_type);                                                      \
+       source_position_t pos = HERE;                                         \
                                                                           \
        expression_t *right = parse_sub_expression(precedence + lr);          \
                                                                           \
        expression_t *binexpr = allocate_expression_zero(binexpression_type); \
+       binexpr->base.source_position = pos;                                  \
        binexpr->binary.left  = left;                                         \
        binexpr->binary.right = right;                                        \
        sfunc(&binexpr->binary);                                              \
index 63cbeac..c1c076c 100644 (file)
--- a/warning.c
+++ b/warning.c
@@ -60,7 +60,7 @@ warning_t warning = {
        .check_format                  = true,
        .empty_statement               = false,
        .fatal_errors                  = false,
-       .float_equal                   = true,
+       .float_equal                   = false,
        .implicit_function_declaration = true,
        .implicit_int                  = true,
        .main                          = true,
@@ -71,5 +71,6 @@ warning_t warning = {
        .strict_prototypes             = true,
        .switch_default                = false,
        .unknown_pragmas               = true,
+       .unused_label                  = false,
        .unused_value                  = true
 };