mirror of
https://github.com/protocolbuffers/protobuf
synced 2026-08-26 02:23:14 -04:00
Build with -Wundef (#17845)
This allows downstream consumers of protobuf to enable Wundef in their code which consumes protobuf APIs.
Closes #17845
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/17845 from cramertj:wundef 8750f8c5f8
PiperOrigin-RevId: 700721632
This commit is contained in:
parent
7588e512b6
commit
653f511ad4
8 changed files with 9 additions and 7 deletions
|
|
@ -2,5 +2,6 @@ import common.bazelrc
|
|||
|
||||
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
|
||||
build --cxxopt="-Woverloaded-virtual"
|
||||
build --copt="-Wpointer-arith"
|
||||
build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion" --copt="-Wno-deprecated-declarations"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import common.bazelrc
|
|||
|
||||
build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
|
||||
build --cxxopt="-Woverloaded-virtual"
|
||||
build --copt="-Wpointer-arith"
|
||||
build --copt="-Werror" --copt="-Wno-sign-compare" --copt="-Wno-sign-conversion" --copt="-Wno-error=sign-conversion" --copt="-Wno-deprecated-declarations"
|
||||
common --repo_env=BAZEL_NO_APPLE_CPP_TOOLCHAIN=1
|
||||
common --xcode_version_config=@com_google_protobuf//.github:host_xcodes
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ using google::protobuf::io::win32::write;
|
|||
|
||||
// Disable the whole test when we use tcmalloc for "draconian" heap checks, in
|
||||
// which case tcmalloc will print warnings that fail the plugin tests.
|
||||
#if !GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN
|
||||
#if !defined(GOOGLE_PROTOBUF_HEAP_CHECK_DRACONIAN)
|
||||
|
||||
|
||||
namespace {
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class PROTOBUF_EXPORT CachedSize {
|
|||
// NOLINTNEXTLINE(google-explicit-constructor)
|
||||
constexpr CachedSize(Scalar desired) noexcept : atom_(desired) {}
|
||||
|
||||
#if PROTOBUF_BUILTIN_ATOMIC
|
||||
#ifdef PROTOBUF_BUILTIN_ATOMIC
|
||||
constexpr CachedSize(const CachedSize& other) = default;
|
||||
|
||||
Scalar Get() const noexcept {
|
||||
|
|
@ -233,7 +233,7 @@ class PROTOBUF_EXPORT CachedSize {
|
|||
#endif
|
||||
|
||||
private:
|
||||
#if PROTOBUF_BUILTIN_ATOMIC
|
||||
#ifdef PROTOBUF_BUILTIN_ATOMIC
|
||||
mutable Scalar atom_;
|
||||
#else
|
||||
mutable std::atomic<Scalar> atom_;
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ bool UPB_PRIVATE(_upb_Message_EnsureAvailable)(struct upb_Message* msg,
|
|||
return true;
|
||||
}
|
||||
|
||||
#if UPB_TRACING_ENABLED
|
||||
#ifdef UPB_TRACING_ENABLED
|
||||
static void (*_message_trace_handler)(const upb_MiniTable*, const upb_Arena*);
|
||||
|
||||
void upb_Message_LogNewMessage(const upb_MiniTable* m, const upb_Arena* arena) {
|
||||
|
|
|
|||
|
|
@ -742,7 +742,7 @@ static upb_MiniTable* upb_MtDecoder_DoBuildMiniTableWithBuf(
|
|||
decoder->table->UPB_PRIVATE(dense_below) = 0;
|
||||
decoder->table->UPB_PRIVATE(table_mask) = -1;
|
||||
decoder->table->UPB_PRIVATE(required_count) = 0;
|
||||
#if UPB_TRACING_ENABLED
|
||||
#ifdef UPB_TRACING_ENABLED
|
||||
// MiniTables built from MiniDescriptors will not be able to vend the message
|
||||
// name unless it is explicitly set with upb_MiniTable_SetFullName().
|
||||
decoder->table->UPB_PRIVATE(full_name) = 0;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#if defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 0
|
||||
// This header is checked in.
|
||||
#include "upb/reflection/stage0/google/protobuf/descriptor.upb.h"
|
||||
#elif UPB_BOOTSTRAP_STAGE == 1
|
||||
#elif defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 1
|
||||
// This header is generated at build time by the bootstrapping process.
|
||||
#include "upb/reflection/stage1/google/protobuf/descriptor.upb.h"
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#if defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 0
|
||||
// This header is checked in.
|
||||
#include "upb_generator/stage0/google/protobuf/compiler/plugin.upb.h"
|
||||
#elif UPB_BOOTSTRAP_STAGE == 1
|
||||
#elif defined(UPB_BOOTSTRAP_STAGE) && UPB_BOOTSTRAP_STAGE == 1
|
||||
// This header is generated at build time by the bootstrapping process.
|
||||
#include "upb_generator/stage1/google/protobuf/compiler/plugin.upb.h"
|
||||
#else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue