ART: More warnings
Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general,
and -Wunused-but-set-parameter for GCC builds.
Change-Id: I81bbdd762213444673c65d85edae594a523836e5
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc
index 761441e..16bc33f 100644
--- a/runtime/dex_file.cc
+++ b/runtime/dex_file.cc
@@ -39,7 +39,6 @@
#include "mirror/string.h"
#include "os.h"
#include "safe_map.h"
-#include "ScopedFd.h"
#include "handle_scope-inl.h"
#include "thread.h"
#include "utf-inl.h"
@@ -47,6 +46,11 @@
#include "well_known_classes.h"
#include "zip_archive.h"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wshadow"
+#include "ScopedFd.h"
+#pragma GCC diagnostic pop
+
namespace art {
const uint8_t DexFile::kDexMagic[] = { 'd', 'e', 'x', '\n' };
@@ -454,8 +458,8 @@
index = new Index(num_class_defs);
for (uint32_t i = 0; i < num_class_defs; ++i) {
const ClassDef& class_def = GetClassDef(i);
- const char* descriptor = GetClassDescriptor(class_def);
- index->insert(std::make_pair(descriptor, &class_def));
+ const char* class_descriptor = GetClassDescriptor(class_def);
+ index->insert(std::make_pair(class_descriptor, &class_def));
}
// Sanity check the index still doesn't exist, only 1 thread should build it.
CHECK(class_def_index_.LoadSequentiallyConsistent() == nullptr);