upb previously attempted to support C89 and pre-2015 versions
of Visual Studio. This was to support older compilers with
limited C99 support (particularly MSVC). But as of last August,
even gRPC has dropped support for MSVC prior to 2015
c87276d058
Therefore it seems safe for upb to no longer attempt C89 support
(we were already not truly C89 compliant, with our use of "bool").
We now explicitly require C99 or greater and MSVC 2015 or greater.
This cleaned up port_def.inc a fair bit. I took the chance to
also remove some obsolete macros.
* Added -Wextra and -Wshorten-64-to-32 and fixed resulting errors.
* Disable -Wshorten-32-to-64 since Kokoro is missing Clang.
* Fixed -Wextra warnings for gcc.
* Reordered UPB_UNUSED() to come after declarations.
* Added another -pedantic fix and log CC version.
* Fix compile error and conditionally run use_bazel.sh.
* Moved set -e after use_bazel.sh.
* Fixed typo in conditional.
upb/json/parser.rl: In function 'end_member.isra.150':
bazel-out/k8-opt/bin/upb.c:5536:13: error: 'sel' may be used uninitialized in this function [-Werror=maybe-uninitialized]
upb_func *ret = (upb_func *)h->table[s].func;
This doesn't fully share bytecode. If you generate for message A
which has B as a sub-message, then generate B, B's code will be
generated twice. This could be optimized later if desired. But
this addresses the leak in PHP.
Also removed some obsolete JIT-only code.
1. For decoding, an unknownfields will be lazily created on message,
which contains bytes of unknown fields.
2. For encoding, if the unknownfields is present on message, all bytes
contained in it will be serialized.