Due to https://bugs.llvm.org/show_bug.cgi?id=34198, clang's static
analyzer emits diagnostics about leaking `container`. Doing this
assignment in two steps works around this, and shouldn't cause these
issues.
The typedefs for Atomic32 and Atomic64 were sometimes causing
Atomic32 to be an int32 rather than an intptr_t on 32-bit platforms.
On some of these platforms (ARM/CortexM building with GCC 6 in one
case) int32 is a long int, while intptr_t is an int, which causes a
compiler error even though long int and int are both 4 bytes.
Having Atomic32 always be intptr_t on 32-bit platforms and Atomic64
always be intptr_t on 64-bit platforms should resolve any of these
types of errors.
Both test_messages_proto3.proto & test_messages_proto2.proto define
message ForeignMessage {...} and enum ForeignEnum {...} but since
objc doesn't use the proto package in the naming, these end up
conflicting.
Adding the objc_class_prefix option to the proto3 file ensure the generated
objc types are all unique.
AddDescriptorsImpl() is a private static implementation detail,
and needs to be declared but won't be used from outside the
source file. Place it inside an anonymous namespace to fix a
previous build error that would result in more restrictive
build enviornments that use -Werror=missing-declarations or
similar compiler flags.
Treat missing declarations as an error for test builds, to prevent
future updates which add functions without properly declaring them.
This will prevent broken builds in more restrictive build environments.
An ifdef condition seems to have been inverted by mistake, causing the
dynamic initialization to occur for lite if and only if the
_NO_STATIC_INITIALIZER macro is set. This problem manifested itself as
segfaults due to uninitialized empty strings:
https://github.com/google/protobuf/issues/2839
Since no one complained about initialization not happening, it would
appear that we can just disable this initialization for lite
unconditionally, so that is what this change does. Instead of the
default instance initialization happening pre-main, it now always
happens lazily when needed.