Skip to content

Commit

Permalink
PR #1788: Fix warning for sign-conversion on riscv
Browse files Browse the repository at this point in the history
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
  • Loading branch information
luyahan authored and copybara-github committed Dec 3, 2024
1 parent 6757696 commit a3f7e98
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion absl/debugging/internal/stacktrace_riscv-inl.inc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ template <typename T>
static inline ptrdiff_t ComputeStackFrameSize(const T *low, const T *high) {
const char *low_char_ptr = reinterpret_cast<const char *>(low);
const char *high_char_ptr = reinterpret_cast<const char *>(high);
return low < high ? high_char_ptr - low_char_ptr : kUnknownFrameSize;
return low < high ? static_cast<ptrdiff_t>(high_char_ptr - low_char_ptr)
: kUnknownFrameSize;
}

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

0 comments on commit a3f7e98

Please sign in to comment.