diff --git a/absl/cleanup/internal/cleanup.h b/absl/cleanup/internal/cleanup.h index 967513a85a6..4dd6f9132b9 100644 --- a/absl/cleanup/internal/cleanup.h +++ b/absl/cleanup/internal/cleanup.h @@ -88,7 +88,7 @@ class Storage { private: bool is_callback_engaged_; - alignas(Callback) char callback_buffer_[sizeof(Callback)]; + alignas(Callback) unsigned char callback_buffer_[sizeof(Callback)]; }; } // namespace cleanup_internal diff --git a/absl/container/fixed_array.h b/absl/container/fixed_array.h index b213eb13b72..8bf8e6cf1af 100644 --- a/absl/container/fixed_array.h +++ b/absl/container/fixed_array.h @@ -447,7 +447,8 @@ class ABSL_ATTRIBUTE_WARN_UNUSED FixedArray { private: ABSL_ADDRESS_SANITIZER_REDZONE(redzone_begin_); - alignas(StorageElement) char buff_[sizeof(StorageElement[inline_elements])]; + alignas(StorageElement) unsigned char buff_[sizeof( + StorageElement[inline_elements])]; ABSL_ADDRESS_SANITIZER_REDZONE(redzone_end_); }; diff --git a/absl/container/internal/inlined_vector.h b/absl/container/internal/inlined_vector.h index a3b14a229ac..b0d3f077e6c 100644 --- a/absl/container/internal/inlined_vector.h +++ b/absl/container/internal/inlined_vector.h @@ -543,7 +543,7 @@ class Storage { (std::max)(N, sizeof(Allocated) / sizeof(ValueType)); struct Inlined { - alignas(ValueType) char inlined_data[sizeof( + alignas(ValueType) unsigned char inlined_data[sizeof( ValueType[kOptimalInlinedSize])]; }; diff --git a/absl/functional/internal/any_invocable.h b/absl/functional/internal/any_invocable.h index 6bfc4d1a7dd..167d947d4c5 100644 --- a/absl/functional/internal/any_invocable.h +++ b/absl/functional/internal/any_invocable.h @@ -174,7 +174,7 @@ union TypeErasedState { } remote; // Local-storage for the type-erased object when small and trivial enough - alignas(kAlignment) char storage[kStorageSize]; + alignas(kAlignment) unsigned char storage[kStorageSize]; }; // A typed accessor for the object in `TypeErasedState` storage diff --git a/absl/synchronization/mutex_test.cc b/absl/synchronization/mutex_test.cc index 2dc4d7393a3..d8c4fdf2b38 100644 --- a/absl/synchronization/mutex_test.cc +++ b/absl/synchronization/mutex_test.cc @@ -1725,7 +1725,7 @@ TEST(Mutex, Logging) { TEST(Mutex, LoggingAddressReuse) { // Repeatedly re-create a Mutex with debug logging at the same address. ScopedInvariantDebugging scoped_debugging; - alignas(absl::Mutex) char storage[sizeof(absl::Mutex)]; + alignas(absl::Mutex) unsigned char storage[sizeof(absl::Mutex)]; auto invariant = +[](void *alive) { EXPECT_TRUE(*static_cast(alive)); }; constexpr size_t kIters = 10;