[Wconversion] Suppress warnings

Bug: 58162
Change-Id: Ia9a2c4f472f01652fc6bfed448f76f7f5b5d9d61
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/protobuf/+/425879
Reviewed-by: Roland McGrath <mcgrathr@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index cfd03a6..db3f81b 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -41,18 +41,20 @@
   if (is_clang) {
     # protobuf-3 contains a few functions that are unused.
     cflags += [ "-Wno-unused-function" ]
+
     # Note(rudominer) I added these because there were a lot of warnings.
-    cflags += [ "-Wno-sign-compare",
-                "-Wno-missing-field-initializers",
-                "-Wno-enum-compare-switch",
-                "-Wno-conversion" ]
+    cflags += [
+      "-Wno-sign-compare",
+      "-Wno-missing-field-initializers",
+      "-Wno-enum-compare-switch",
+      "-Wno-conversion",
+    ]
   }
 }
 
 executable("js_embed") {
-  sources = [
-    "src/google/protobuf/compiler/js/embed.cc",
-  ]
+  sources = [ "src/google/protobuf/compiler/js/embed.cc" ]
+  configs += [ ":protobuf_warnings" ]
 }
 
 compiled_action("run_js_embed") {
@@ -65,13 +67,15 @@
   ]
 
   outputs = [
-   "$target_gen_dir/google/protobuf/compiler/js/well_known_types_embed.cc",
+    "$target_gen_dir/google/protobuf/compiler/js/well_known_types_embed.cc",
   ]
 
   args = [
-      "--output_file",
-      rebase_path("$target_gen_dir/google/protobuf/compiler/js/well_known_types_embed.cc", root_build_dir),
-  ] + rebase_path(inputs, root_build_dir)
+           "--output_file",
+           rebase_path(
+               "$target_gen_dir/google/protobuf/compiler/js/well_known_types_embed.cc",
+               root_build_dir),
+         ] + rebase_path(inputs, root_build_dir)
 }
 
 # This config should be applied to targets using generated code from the proto
@@ -107,6 +111,7 @@
   "src/google/protobuf/message_lite.h",
   "src/google/protobuf/repeated_field.cc",
   "src/google/protobuf/repeated_field.h",
+  "src/google/protobuf/stubs/atomic_sequence_num.h",
   "src/google/protobuf/stubs/atomicops.h",
   "src/google/protobuf/stubs/atomicops_internals_arm64_gcc.h",
   "src/google/protobuf/stubs/atomicops_internals_arm_gcc.h",
@@ -122,7 +127,6 @@
   "src/google/protobuf/stubs/atomicops_internals_x86_gcc.h",
   "src/google/protobuf/stubs/atomicops_internals_x86_msvc.cc",
   "src/google/protobuf/stubs/atomicops_internals_x86_msvc.h",
-  "src/google/protobuf/stubs/atomic_sequence_num.h",
   "src/google/protobuf/stubs/bytestream.cc",
   "src/google/protobuf/stubs/bytestream.h",
   "src/google/protobuf/stubs/callback.h",
@@ -157,9 +161,9 @@
   "src/google/protobuf/stubs/strutil.cc",
   "src/google/protobuf/stubs/strutil.h",
   "src/google/protobuf/stubs/template_util.h",
-  "src/google/protobuf/stubs/type_traits.h",
   "src/google/protobuf/stubs/time.cc",
   "src/google/protobuf/stubs/time.h",
+  "src/google/protobuf/stubs/type_traits.h",
   "src/google/protobuf/wire_format_lite.cc",
   "src/google/protobuf/wire_format_lite.h",
   "src/google/protobuf/wire_format_lite_inl.h",
@@ -167,12 +171,8 @@
 
 static_library("protobuf_lite") {
   sources = protobuf_lite_sources
-  configs += [
-    ":protobuf_warnings",
-  ]
-  public_configs = [
-    ":protobuf_config",
-  ]
+  configs += [ ":protobuf_warnings" ]
+  public_configs = [ ":protobuf_config" ]
   cflags = []
 }
 
@@ -181,136 +181,133 @@
 # into that category.
 static_library("protobuf_full") {
   sources = protobuf_lite_sources + [
-    "src/google/protobuf/any.cc",
-    "src/google/protobuf/any.h",
-    "src/google/protobuf/any.pb.cc",
-    "src/google/protobuf/any.pb.h",
-    "src/google/protobuf/api.pb.cc",
-    "src/google/protobuf/api.pb.h",
-    "src/google/protobuf/compiler/importer.cc",
-    "src/google/protobuf/compiler/importer.h",
-    "src/google/protobuf/compiler/parser.cc",
-    "src/google/protobuf/compiler/parser.h",
-    "src/google/protobuf/descriptor.cc",
-    "src/google/protobuf/descriptor.h",
-    "src/google/protobuf/descriptor.pb.cc",
-    "src/google/protobuf/descriptor.pb.h",
-    "src/google/protobuf/descriptor_database.cc",
-    "src/google/protobuf/descriptor_database.h",
-    "src/google/protobuf/duration.pb.cc",
-    "src/google/protobuf/duration.pb.h",
-    "src/google/protobuf/dynamic_message.cc",
-    "src/google/protobuf/dynamic_message.h",
-    "src/google/protobuf/empty.pb.cc",
-    "src/google/protobuf/empty.pb.h",
-    "src/google/protobuf/extension_set_heavy.cc",
-    "src/google/protobuf/field_mask.pb.cc",
-    "src/google/protobuf/field_mask.pb.h",
-    "src/google/protobuf/generated_enum_reflection.h",
-    "src/google/protobuf/generated_enum_util.h",
-    "src/google/protobuf/generated_message_reflection.cc",
-    "src/google/protobuf/generated_message_reflection.h",
-    # gzip_stream.cc pulls in zlib, but it's not actually used by protoc, just
-    # by test code, so instead of compiling zlib for the host, let's just
-    # exclude this.
-    # "src/google/protobuf/io/gzip_stream.cc",
-    # "src/google/protobuf/io/gzip_stream.h",
-    "src/google/protobuf/io/printer.cc",
-    "src/google/protobuf/io/printer.h",
-    "src/google/protobuf/io/strtod.cc",
-    "src/google/protobuf/io/strtod.h",
-    "src/google/protobuf/io/tokenizer.cc",
-    "src/google/protobuf/io/tokenizer.h",
-    "src/google/protobuf/io/zero_copy_stream_impl.cc",
-    "src/google/protobuf/io/zero_copy_stream_impl.h",
-    "src/google/protobuf/map_entry.h",
-    "src/google/protobuf/map_field.cc",
-    "src/google/protobuf/map_field.h",
-    "src/google/protobuf/map_field_inl.h",
-    "src/google/protobuf/message.cc",
-    "src/google/protobuf/message.h",
-    "src/google/protobuf/metadata.h",
-    "src/google/protobuf/reflection.h",
-    "src/google/protobuf/reflection_internal.h",
-    "src/google/protobuf/reflection_ops.cc",
-    "src/google/protobuf/reflection_ops.h",
-    "src/google/protobuf/service.cc",
-    "src/google/protobuf/service.h",
-    "src/google/protobuf/source_context.pb.cc",
-    "src/google/protobuf/source_context.pb.h",
-    "src/google/protobuf/struct.pb.cc",
-    "src/google/protobuf/struct.pb.h",
-    "src/google/protobuf/stubs/mathlimits.cc",
-    "src/google/protobuf/stubs/mathlimits.h",
-    "src/google/protobuf/stubs/mathutil.h",
-    "src/google/protobuf/stubs/singleton.h",
-    "src/google/protobuf/stubs/substitute.cc",
-    "src/google/protobuf/stubs/substitute.h",
-    "src/google/protobuf/text_format.cc",
-    "src/google/protobuf/text_format.h",
-    "src/google/protobuf/timestamp.pb.cc",
-    "src/google/protobuf/timestamp.pb.h",
-    "src/google/protobuf/type.pb.cc",
-    "src/google/protobuf/type.pb.h",
-    "src/google/protobuf/unknown_field_set.cc",
-    "src/google/protobuf/unknown_field_set.h",
-    "src/google/protobuf/util/field_comparator.cc",
-    "src/google/protobuf/util/field_comparator.h",
-    "src/google/protobuf/util/field_mask_util.cc",
-    "src/google/protobuf/util/field_mask_util.h",
-    "src/google/protobuf/util/internal/constants.h",
-    "src/google/protobuf/util/internal/datapiece.cc",
-    "src/google/protobuf/util/internal/datapiece.h",
-    "src/google/protobuf/util/internal/default_value_objectwriter.cc",
-    "src/google/protobuf/util/internal/default_value_objectwriter.h",
-    "src/google/protobuf/util/internal/error_listener.cc",
-    "src/google/protobuf/util/internal/error_listener.h",
-    "src/google/protobuf/util/internal/field_mask_utility.cc",
-    "src/google/protobuf/util/internal/field_mask_utility.h",
-    "src/google/protobuf/util/internal/json_escaping.cc",
-    "src/google/protobuf/util/internal/json_escaping.h",
-    "src/google/protobuf/util/internal/json_objectwriter.cc",
-    "src/google/protobuf/util/internal/json_objectwriter.h",
-    "src/google/protobuf/util/internal/json_stream_parser.cc",
-    "src/google/protobuf/util/internal/json_stream_parser.h",
-    "src/google/protobuf/util/internal/location_tracker.h",
-    "src/google/protobuf/util/internal/object_location_tracker.h",
-    "src/google/protobuf/util/internal/object_source.h",
-    "src/google/protobuf/util/internal/object_writer.cc",
-    "src/google/protobuf/util/internal/object_writer.h",
-    "src/google/protobuf/util/internal/proto_writer.cc",
-    "src/google/protobuf/util/internal/proto_writer.h",
-    "src/google/protobuf/util/internal/protostream_objectsource.cc",
-    "src/google/protobuf/util/internal/protostream_objectsource.h",
-    "src/google/protobuf/util/internal/protostream_objectwriter.cc",
-    "src/google/protobuf/util/internal/protostream_objectwriter.h",
-    "src/google/protobuf/util/internal/structured_objectwriter.h",
-    "src/google/protobuf/util/internal/type_info.cc",
-    "src/google/protobuf/util/internal/type_info.h",
-    "src/google/protobuf/util/internal/type_info_test_helper.cc",
-    "src/google/protobuf/util/internal/type_info_test_helper.h",
-    "src/google/protobuf/util/internal/utility.cc",
-    "src/google/protobuf/util/internal/utility.h",
-    "src/google/protobuf/util/json_util.cc",
-    "src/google/protobuf/util/json_util.h",
-    "src/google/protobuf/util/message_differencer.cc",
-    "src/google/protobuf/util/message_differencer.h",
-    "src/google/protobuf/util/time_util.cc",
-    "src/google/protobuf/util/time_util.h",
-    "src/google/protobuf/util/type_resolver.h",
-    "src/google/protobuf/util/type_resolver_util.cc",
-    "src/google/protobuf/util/type_resolver_util.h",
-    "src/google/protobuf/wire_format.cc",
-    "src/google/protobuf/wire_format.h",
-    "src/google/protobuf/wrappers.pb.cc",
-    "src/google/protobuf/wrappers.pb.h",
-  ]
-  configs += [
-    ":protobuf_warnings",
-  ]
-  public_configs = [
-    ":protobuf_config",
-  ]
+              "src/google/protobuf/any.cc",
+              "src/google/protobuf/any.h",
+              "src/google/protobuf/any.pb.cc",
+              "src/google/protobuf/any.pb.h",
+              "src/google/protobuf/api.pb.cc",
+              "src/google/protobuf/api.pb.h",
+              "src/google/protobuf/compiler/importer.cc",
+              "src/google/protobuf/compiler/importer.h",
+              "src/google/protobuf/compiler/parser.cc",
+              "src/google/protobuf/compiler/parser.h",
+              "src/google/protobuf/descriptor.cc",
+              "src/google/protobuf/descriptor.h",
+              "src/google/protobuf/descriptor.pb.cc",
+              "src/google/protobuf/descriptor.pb.h",
+              "src/google/protobuf/descriptor_database.cc",
+              "src/google/protobuf/descriptor_database.h",
+              "src/google/protobuf/duration.pb.cc",
+              "src/google/protobuf/duration.pb.h",
+              "src/google/protobuf/dynamic_message.cc",
+              "src/google/protobuf/dynamic_message.h",
+              "src/google/protobuf/empty.pb.cc",
+              "src/google/protobuf/empty.pb.h",
+              "src/google/protobuf/extension_set_heavy.cc",
+              "src/google/protobuf/field_mask.pb.cc",
+              "src/google/protobuf/field_mask.pb.h",
+              "src/google/protobuf/generated_enum_reflection.h",
+              "src/google/protobuf/generated_enum_util.h",
+              "src/google/protobuf/generated_message_reflection.cc",
+              "src/google/protobuf/generated_message_reflection.h",
+
+              # gzip_stream.cc pulls in zlib, but it's not actually used by protoc, just
+              # by test code, so instead of compiling zlib for the host, let's just
+              # exclude this.
+              # "src/google/protobuf/io/gzip_stream.cc",
+              # "src/google/protobuf/io/gzip_stream.h",
+              "src/google/protobuf/io/printer.cc",
+              "src/google/protobuf/io/printer.h",
+              "src/google/protobuf/io/strtod.cc",
+              "src/google/protobuf/io/strtod.h",
+              "src/google/protobuf/io/tokenizer.cc",
+              "src/google/protobuf/io/tokenizer.h",
+              "src/google/protobuf/io/zero_copy_stream_impl.cc",
+              "src/google/protobuf/io/zero_copy_stream_impl.h",
+              "src/google/protobuf/map_entry.h",
+              "src/google/protobuf/map_field.cc",
+              "src/google/protobuf/map_field.h",
+              "src/google/protobuf/map_field_inl.h",
+              "src/google/protobuf/message.cc",
+              "src/google/protobuf/message.h",
+              "src/google/protobuf/metadata.h",
+              "src/google/protobuf/reflection.h",
+              "src/google/protobuf/reflection_internal.h",
+              "src/google/protobuf/reflection_ops.cc",
+              "src/google/protobuf/reflection_ops.h",
+              "src/google/protobuf/service.cc",
+              "src/google/protobuf/service.h",
+              "src/google/protobuf/source_context.pb.cc",
+              "src/google/protobuf/source_context.pb.h",
+              "src/google/protobuf/struct.pb.cc",
+              "src/google/protobuf/struct.pb.h",
+              "src/google/protobuf/stubs/mathlimits.cc",
+              "src/google/protobuf/stubs/mathlimits.h",
+              "src/google/protobuf/stubs/mathutil.h",
+              "src/google/protobuf/stubs/singleton.h",
+              "src/google/protobuf/stubs/substitute.cc",
+              "src/google/protobuf/stubs/substitute.h",
+              "src/google/protobuf/text_format.cc",
+              "src/google/protobuf/text_format.h",
+              "src/google/protobuf/timestamp.pb.cc",
+              "src/google/protobuf/timestamp.pb.h",
+              "src/google/protobuf/type.pb.cc",
+              "src/google/protobuf/type.pb.h",
+              "src/google/protobuf/unknown_field_set.cc",
+              "src/google/protobuf/unknown_field_set.h",
+              "src/google/protobuf/util/field_comparator.cc",
+              "src/google/protobuf/util/field_comparator.h",
+              "src/google/protobuf/util/field_mask_util.cc",
+              "src/google/protobuf/util/field_mask_util.h",
+              "src/google/protobuf/util/internal/constants.h",
+              "src/google/protobuf/util/internal/datapiece.cc",
+              "src/google/protobuf/util/internal/datapiece.h",
+              "src/google/protobuf/util/internal/default_value_objectwriter.cc",
+              "src/google/protobuf/util/internal/default_value_objectwriter.h",
+              "src/google/protobuf/util/internal/error_listener.cc",
+              "src/google/protobuf/util/internal/error_listener.h",
+              "src/google/protobuf/util/internal/field_mask_utility.cc",
+              "src/google/protobuf/util/internal/field_mask_utility.h",
+              "src/google/protobuf/util/internal/json_escaping.cc",
+              "src/google/protobuf/util/internal/json_escaping.h",
+              "src/google/protobuf/util/internal/json_objectwriter.cc",
+              "src/google/protobuf/util/internal/json_objectwriter.h",
+              "src/google/protobuf/util/internal/json_stream_parser.cc",
+              "src/google/protobuf/util/internal/json_stream_parser.h",
+              "src/google/protobuf/util/internal/location_tracker.h",
+              "src/google/protobuf/util/internal/object_location_tracker.h",
+              "src/google/protobuf/util/internal/object_source.h",
+              "src/google/protobuf/util/internal/object_writer.cc",
+              "src/google/protobuf/util/internal/object_writer.h",
+              "src/google/protobuf/util/internal/proto_writer.cc",
+              "src/google/protobuf/util/internal/proto_writer.h",
+              "src/google/protobuf/util/internal/protostream_objectsource.cc",
+              "src/google/protobuf/util/internal/protostream_objectsource.h",
+              "src/google/protobuf/util/internal/protostream_objectwriter.cc",
+              "src/google/protobuf/util/internal/protostream_objectwriter.h",
+              "src/google/protobuf/util/internal/structured_objectwriter.h",
+              "src/google/protobuf/util/internal/type_info.cc",
+              "src/google/protobuf/util/internal/type_info.h",
+              "src/google/protobuf/util/internal/type_info_test_helper.cc",
+              "src/google/protobuf/util/internal/type_info_test_helper.h",
+              "src/google/protobuf/util/internal/utility.cc",
+              "src/google/protobuf/util/internal/utility.h",
+              "src/google/protobuf/util/json_util.cc",
+              "src/google/protobuf/util/json_util.h",
+              "src/google/protobuf/util/message_differencer.cc",
+              "src/google/protobuf/util/message_differencer.h",
+              "src/google/protobuf/util/time_util.cc",
+              "src/google/protobuf/util/time_util.h",
+              "src/google/protobuf/util/type_resolver.h",
+              "src/google/protobuf/util/type_resolver_util.cc",
+              "src/google/protobuf/util/type_resolver_util.h",
+              "src/google/protobuf/wire_format.cc",
+              "src/google/protobuf/wire_format.h",
+              "src/google/protobuf/wrappers.pb.cc",
+              "src/google/protobuf/wrappers.pb.h",
+            ]
+  configs += [ ":protobuf_warnings" ]
+  public_configs = [ ":protobuf_config" ]
   cflags = []
 }
 
@@ -321,6 +318,8 @@
   # itself. See src/google/protobuf/compiler/plugin.h
   static_library("protoc_lib") {
     sources = [
+      "$target_gen_dir/google/protobuf/compiler/js/well_known_types_embed.cc",
+      "src//google/protobuf/compiler/js/well_known_types_embed.h",
       "src/google/protobuf/compiler/code_generator.cc",
       "src/google/protobuf/compiler/code_generator.h",
       "src/google/protobuf/compiler/command_line_interface.cc",
@@ -470,8 +469,6 @@
       "src/google/protobuf/compiler/javanano/javanano_primitive_field.h",
       "src/google/protobuf/compiler/js/js_generator.cc",
       "src/google/protobuf/compiler/js/js_generator.h",
-      "$target_gen_dir/google/protobuf/compiler/js/well_known_types_embed.cc",
-      "src//google/protobuf/compiler/js/well_known_types_embed.h",
       "src/google/protobuf/compiler/objectivec/objectivec_enum.cc",
       "src/google/protobuf/compiler/objectivec/objectivec_enum.h",
       "src/google/protobuf/compiler/objectivec/objectivec_enum_field.cc",
@@ -511,9 +508,7 @@
       "src/google/protobuf/compiler/zip_writer.cc",
       "src/google/protobuf/compiler/zip_writer.h",
     ]
-    configs += [
-      ":protobuf_warnings",
-    ]
+    configs += [ ":protobuf_warnings" ]
     public_deps = [
       ":protobuf_full",
       ":run_js_embed",
@@ -521,11 +516,7 @@
   }
 
   executable("protoc") {
-    sources = [
-      "src/google/protobuf/compiler/main.cc",
-    ]
-    deps = [
-      ":protoc_lib",
-    ]
+    sources = [ "src/google/protobuf/compiler/main.cc" ]
+    deps = [ ":protoc_lib" ]
   }
 }