# HG changeset patch # User Manuele Conti # Date 1353239688 -3600 # Node ID 0304ff59fd7fe6a15057a796b2f897dea65652b7 # Parent 49853bded5397e20e6ffa57d3c12c37a8b1e990f Fix some important clang++ warnings. diff -r 49853bded539 -r 0304ff59fd7f absyntax_utils/debug_ast.cc --- a/absyntax_utils/debug_ast.cc Thu Nov 15 14:14:00 2012 +0000 +++ b/absyntax_utils/debug_ast.cc Sun Nov 18 12:54:48 2012 +0100 @@ -100,8 +100,9 @@ fprintf(stderr, " datatype="); if (NULL == symbol->datatype) fprintf(stderr, "NULL\t\t"); - else - fprintf(stderr, symbol->datatype->absyntax_cname()); + else { + fprintf(stderr, "%s", symbol->datatype->absyntax_cname()); + } fprintf(stderr, "\t<-{"); if (symbol->candidate_datatypes.size() == 0) { fprintf(stderr, "\t\t\t\t\t"); @@ -112,7 +113,7 @@ else fprintf(stderr, "\t\t\t"); } else { - fprintf(stderr, "(%d)\t\t\t\t\t", symbol->candidate_datatypes.size()); + fprintf(stderr, "(%ld)\t\t\t\t\t", symbol->candidate_datatypes.size()); } fprintf(stderr, "}\t"); @@ -126,8 +127,8 @@ void *print_symbol_c::visit(il_instruction_c *symbol) { dump_symbol(symbol); - fprintf(stderr, " next_il_=%d ", symbol->next_il_instruction.size()); - fprintf(stderr, " prev_il_=%d ", symbol->prev_il_instruction.size()); + fprintf(stderr, " next_il_=%ld ", symbol->next_il_instruction.size()); + fprintf(stderr, " prev_il_=%ld ", symbol->prev_il_instruction.size()); if (symbol->prev_il_instruction.size() == 0) fprintf(stderr, "(----,"); diff -r 49853bded539 -r 0304ff59fd7f stage3/constant_folding.cc --- a/stage3/constant_folding.cc Thu Nov 15 14:14:00 2012 +0000 +++ b/stage3/constant_folding.cc Sun Nov 18 12:54:48 2012 +0100 @@ -253,7 +253,7 @@ int64_t ret; std::string str = ""; char *endptr; - const char *value; + const char *value = NULL; int base; integer_c *integer; hex_integer_c *hex_integer; @@ -285,7 +285,7 @@ uint64_t ret; std::string str = ""; char *endptr; - const char *value; + const char *value = NULL; int base; integer_c *integer; hex_integer_c *hex_integer; diff -r 49853bded539 -r 0304ff59fd7f stage3/fill_candidate_datatypes.cc --- a/stage3/fill_candidate_datatypes.cc Thu Nov 15 14:14:00 2012 +0000 +++ b/stage3/fill_candidate_datatypes.cc Sun Nov 18 12:54:48 2012 +0100 @@ -935,7 +935,7 @@ void *fill_candidate_datatypes_c::visit(enumerated_value_c *symbol) { symbol_c *global_enumerated_type; symbol_c *local_enumerated_type; - symbol_c *enumerated_type; + symbol_c *enumerated_type = NULL; if (NULL != symbol->type) { /* NOTE: This code must take into account the following situation: