Merge pull request #116 from xfxyjwf/fix_warnings

Get rid of some build warnings.
diff --git a/configure.ac b/configure.ac
index c3b04e0..034d0cd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,6 +54,7 @@
 AC_PROG_CXX
 AC_LANG([C++])
 ACX_USE_SYSTEM_EXTENSIONS
+AM_PROG_AR
 AM_CONDITIONAL(GCC, test "$GCC" = yes)   # let the Makefile know if we're gcc
 
 # test_util.cc takes forever to compile with GCC and optimization turned on.
diff --git a/src/google/protobuf/arena.cc b/src/google/protobuf/arena.cc
index be0d9e3..1cb6441 100644
--- a/src/google/protobuf/arena.cc
+++ b/src/google/protobuf/arena.cc
@@ -46,10 +46,10 @@
   max_block_size_ = options.max_block_size;
   block_alloc = options.block_alloc;
   block_dealloc = options.block_dealloc;
-  blocks_ = NULL;
-  hint_ = NULL;
+  blocks_ = 0;
+  hint_ = 0;
   owns_first_block_ = true;
-  cleanup_list_ = NULL;
+  cleanup_list_ = 0;
 
   if (options.initial_block != NULL && options.initial_block_size > 0) {
     // Add first unowned block to list.
diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc
index 7bc172a..19d49ca 100644
--- a/src/google/protobuf/descriptor.cc
+++ b/src/google/protobuf/descriptor.cc
@@ -144,6 +144,8 @@
     case SYNTAX_UNKNOWN:
       return "unknown";
   }
+  GOOGLE_LOG(FATAL) << "can't reach here.";
+  return NULL;
 }
 
 static const char * const kNonLinkedWeakMessageReplacementName = "google.protobuf.Empty";
diff --git a/src/google/protobuf/extension_set.cc b/src/google/protobuf/extension_set.cc
index d6ebe4c..4908713 100644
--- a/src/google/protobuf/extension_set.cc
+++ b/src/google/protobuf/extension_set.cc
@@ -71,6 +71,8 @@
     // Do not add a default statement. Let the compiler complain when someone
     // adds a new wire type.
   }
+  GOOGLE_LOG(FATAL) << "can't reach here.";
+  return false;
 }
 
 // Registry stuff.
diff --git a/src/google/protobuf/generated_message_reflection.cc b/src/google/protobuf/generated_message_reflection.cc
index b4e98ac..b500b9c 100644
--- a/src/google/protobuf/generated_message_reflection.cc
+++ b/src/google/protobuf/generated_message_reflection.cc
@@ -487,11 +487,11 @@
   double temp_double;
   bool temp_bool;
   int temp_int;
-  Message* temp_message;
+  Message* temp_message = NULL;
   string temp_string;
 
   // Stores message1's oneof field to a temp variable.
-  const FieldDescriptor* field1;
+  const FieldDescriptor* field1 = NULL;
   if (oneof_case1 > 0) {
     field1 = descriptor_->FindFieldByNumber(oneof_case1);
     //oneof_descriptor->field(oneof_case1);
diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h
index b7e1174..c0cfd41 100644
--- a/src/google/protobuf/stubs/common.h
+++ b/src/google/protobuf/stubs/common.h
@@ -381,8 +381,9 @@
 
 #undef GOOGLE_COMPILE_ASSERT
 #define GOOGLE_COMPILE_ASSERT(expr, msg) \
-  typedef ::google::protobuf::internal::CompileAssert<(bool(expr))> \
-          msg[bool(expr) ? 1 : -1]
+  ::google::protobuf::internal::CompileAssert<(bool(expr))> \
+          msg[bool(expr) ? 1 : -1]; \
+  (void)msg
 
 
 // Implementation details of COMPILE_ASSERT:
diff --git a/src/google/protobuf/stubs/map_util.h b/src/google/protobuf/stubs/map_util.h
index 7495cb6..4cccbbe 100644
--- a/src/google/protobuf/stubs/map_util.h
+++ b/src/google/protobuf/stubs/map_util.h
@@ -353,7 +353,6 @@
 void InsertOrDie(Collection* const collection,
                  const typename Collection::value_type::first_type& key,
                  const typename Collection::value_type::second_type& data) {
-  typedef typename Collection::value_type value_type;
   GOOGLE_CHECK(InsertIfNotPresent(collection, key, data))
       << "duplicate key: " << key;
 }
@@ -364,7 +363,6 @@
     Collection* const collection,
     const typename Collection::value_type::first_type& key,
     const typename Collection::value_type::second_type& data) {
-  typedef typename Collection::value_type value_type;
   GOOGLE_CHECK(InsertIfNotPresent(collection, key, data)) << "duplicate key.";
 }