mirror of
https://github.com/abseil/abseil-cpp.git
synced 2026-06-04 12:07:05 +08:00
PR #1961: Fix Clang warnings on powerpc
Imported from GitHub PR https://github.com/abseil/abseil-cpp/pull/1961 We maintain the V8 Js Compiler on IBM platforms which uses abseil as a dependency. We have recently switched to using Clang and need to create this patch to fix two warnings: ``` warning: implicit conversion changes signedness: 'uint64_t' (aka 'unsigned long') to 'int64_t' (aka 'long') [-Wsign-conversion] warning: implicit conversion loses integer precision: 'uintptr_t' (aka 'unsigned long') to 'int' [-Wshorten-64-to-32] ``` Merge2e972b5c72intod71fcd13f6Merging this change closes #1961 COPYBARA_INTEGRATE_REVIEW=https://github.com/abseil/abseil-cpp/pull/1961 from miladfarca:ppc-fix-clang-warn2e972b5c72PiperOrigin-RevId: 823581713 Change-Id: Icff10b99b3808f51866fb97576af405826742088
This commit is contained in:
committed by
Copybara-Service
parent
d71fcd13f6
commit
1a259163cc
@@ -62,7 +62,7 @@ double UnscaledCycleClock::Frequency() {
|
||||
|
||||
int64_t UnscaledCycleClock::Now() {
|
||||
#ifdef __GLIBC__
|
||||
return __ppc_get_timebase();
|
||||
return static_cast<int64_t>(__ppc_get_timebase());
|
||||
#else
|
||||
#ifdef __powerpc64__
|
||||
int64_t tbr;
|
||||
|
||||
@@ -223,8 +223,9 @@ static int UnwindImpl(void **result, uintptr_t *frames, int *sizes,
|
||||
}
|
||||
if (sizes != nullptr) {
|
||||
if (next_sp > sp) {
|
||||
sizes[n] = absl::debugging_internal::StripPointerMetadata(next_sp) -
|
||||
absl::debugging_internal::StripPointerMetadata(sp);
|
||||
sizes[n] = static_cast<int>(
|
||||
absl::debugging_internal::StripPointerMetadata(next_sp) -
|
||||
absl::debugging_internal::StripPointerMetadata(sp));
|
||||
} else {
|
||||
// A frame-size of 0 is used to indicate unknown frame size.
|
||||
sizes[n] = 0;
|
||||
|
||||
Reference in New Issue
Block a user