Fix some important clang++ warnings.
authorManuele Conti <conti.ma@alice.it>
Sun, 18 Nov 2012 12:54:48 +0100
changeset 735 0304ff59fd7f
parent 734 49853bded539
child 736 a591ed23c370
Fix some important clang++ warnings.
absyntax_utils/debug_ast.cc
stage3/constant_folding.cc
stage3/fill_candidate_datatypes.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, "(----,");
--- 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;
--- 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: