* Comment out unused arguments.
These last few are all that's needed to compile with -Wunused-arguments.
* Fix missing struct field initializer.
With this fix, everything compiles with -Wmissing-field-initializers.
* Add support for disabling unaligned memory accesses on x86 too.
ubsan doesn't like these because they are technically undefined
behavior, so -DGOOGLE_PROTOBUF_DONT_USE_UNALIGNED will disable them easily.
* Avoid undefined integer overflow.
ubsan catches all of these.
This prevents the contents of the std namespace from being effectively
pulled into the top-level namespace in all translation units that
include common.h. I left in individual using statements for a few common
things like std::set and std::map, because it did not seem worth going
through the churn of updating the whole codebase to fix those right now.
descriptor.proto uses proto2 syntax, which is not ready for external
usage. However, some proto3 files import descriptor.proto and cannot be
used. In this PR, all references (We cheated by only removing
extensions, which is enough for now. User should avoid using messages
defined in descriptor.proto as field type.) to content in
descriptor.proto are removed from generated files. Those that import
descriptor.proto can be used like other proto files.
arm-nacl-clang seems to produce a mysterious compiler error when it
encounters __builtin_clzll, so when we are building for NaCl, let's
avoid that in favor of the portable implementation of
Log2FloorNonZero64.
It turns out system headers included by generated plugin.pb.h file already contains
major/minor macro definitions when built on FreeBSD and we need to add #undefs to
the generated header file.
This change also fixes another compile error regarding EXPECT_DEATH on FreeBSD.