Skip to content

Commit a3f7e98

Browse files
luyahancopybara-github
authored andcommitted
PR #1788: Fix warning for sign-conversion on riscv
Imported from GitHub PR #1788 ``` error: operand of ? changes signedness: 'long' to 'uintptr_t' (aka 'unsigned long') [-Werror,-Wsign-conversion] ``` Merge 82deb4b into 95950b3 Merging this change closes #1788 COPYBARA_INTEGRATE_REVIEW=#1788 from luyahan:luyahan-patch-1 82deb4b PiperOrigin-RevId: 702375910 Change-Id: Ia95d342ddd277dcbde19008e31aaef09f3c3a282
1 parent 6757696 commit a3f7e98

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

absl/debugging/internal/stacktrace_riscv-inl.inc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ template <typename T>
4444
static inline ptrdiff_t ComputeStackFrameSize(const T *low, const T *high) {
4545
const char *low_char_ptr = reinterpret_cast<const char *>(low);
4646
const char *high_char_ptr = reinterpret_cast<const char *>(high);
47-
return low < high ? high_char_ptr - low_char_ptr : kUnknownFrameSize;
47+
return low < high ? static_cast<ptrdiff_t>(high_char_ptr - low_char_ptr)
48+
: kUnknownFrameSize;
4849
}
4950

5051
// Given a pointer to a stack frame, locate and return the calling stackframe,

0 commit comments

Comments
 (0)