From 7fa8c45949cae56fa51370e432ae8d25627da0ba Mon Sep 17 00:00:00 2001 From: Karan Bhatia Date: Thu, 6 Jul 2017 00:20:04 +0000 Subject: [PATCH] Flatbuffers: Ignore exit time destructor warning. DefaultAllocator::instance() method in flatbuffers.h defines a static object, leading to a destructor being run at exit-time. However, many targets in Chrome use the "wexit_time_destructors" compiler config, which generates warnings when exit time destructors are generated. This causes compile errors, when flatbuffers.h is transitively included from a file in one of such targets. To fix this, suppress the exit time destructor warning as part of the flatbuffer config. BUG=737847 Change-Id: I706be9e8c204ed24a82aa04b33b00a78cf36489d Reviewed-on: https://chromium-review.googlesource.com/554318 Commit-Queue: Karan Bhatia Reviewed-by: Charlie Harrison Cr-Commit-Position: refs/heads/master@{#484403} --- third_party/flatbuffers/BUILD.gn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/third_party/flatbuffers/BUILD.gn b/third_party/flatbuffers/BUILD.gn index a1554f29f11b3d..5ce0786ab3c327 100644 --- a/third_party/flatbuffers/BUILD.gn +++ b/third_party/flatbuffers/BUILD.gn @@ -7,6 +7,10 @@ import("//third_party/flatbuffers/flatbuffer.gni") config("flatbuffers_config") { include_dirs = [ "src/include" ] + + if (is_clang) { + cflags = [ "-Wno-exit-time-destructors" ] + } } # The part of FlatBuffers that Chrome is interested in.