Skip to content

Commit

Permalink
Flatbuffers: Ignore exit time destructor warning.
Browse files Browse the repository at this point in the history
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 <karandeepb@chromium.org>
Reviewed-by: Charlie Harrison <csharrison@chromium.org>
Cr-Commit-Position: refs/heads/master@{#484403}
  • Loading branch information
Karan Bhatia authored and Commit Bot committed Jul 6, 2017
1 parent 995f3e6 commit 7fa8c45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions third_party/flatbuffers/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7fa8c45

Please sign in to comment.