Skip to content

[libunwind] Fix return type of DwarfFDECache::findFDE() in definition #146308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alexrp
Copy link
Member

@alexrp alexrp commented Jun 30, 2025

Needed to resolve this compilation error on some systems:

    lib/libunwind/src/UnwindCursor.hpp:153:38: error: return type of out-of-line definition of 'libunwind::DwarfFDECache::findFDE' differs from that in the declaration
typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    lib/libunwind/src/libunwind.cpp:31:10: note: in file included from lib/libunwind/src/libunwind.cpp:31:
#include "UnwindCursor.hpp"
         ^
    lib/libunwind/src/UnwindCursor.hpp:100:17: note: previous declaration is here
  static pint_t findFDE(pint_t mh, pint_t pc);
         ~~~~~~~^

@alexrp alexrp requested a review from a team as a code owner June 30, 2025 04:39
@llvmbot
Copy link
Member

llvmbot commented Jun 30, 2025

@llvm/pr-subscribers-libunwind

Author: Alex Rønne Petersen (alexrp)

Changes

Needed to resolve this compilation error on some systems:

    lib/libunwind/src/UnwindCursor.hpp:153:38: error: return type of out-of-line definition of 'libunwind::DwarfFDECache::findFDE' differs from that in the declaration
typename A::pint_t DwarfFDECache&lt;A&gt;::findFDE(pint_t mh, pint_t pc) {
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
    lib/libunwind/src/libunwind.cpp:31:10: note: in file included from lib/libunwind/src/libunwind.cpp:31:
#include "UnwindCursor.hpp"
         ^
    lib/libunwind/src/UnwindCursor.hpp:100:17: note: previous declaration is here
  static pint_t findFDE(pint_t mh, pint_t pc);
         ~~~~~~~^

Full diff: https://github.com/llvm/llvm-project/pull/146308.diff

1 Files Affected:

  • (modified) libunwind/src/UnwindCursor.hpp (+1-1)
diff --git a/libunwind/src/UnwindCursor.hpp b/libunwind/src/UnwindCursor.hpp
index 55db035e62040..7586749cd2ad5 100644
--- a/libunwind/src/UnwindCursor.hpp
+++ b/libunwind/src/UnwindCursor.hpp
@@ -173,7 +173,7 @@ bool DwarfFDECache<A>::_registeredForDyldUnloads = false;
 #endif
 
 template <typename A>
-typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {
+typename DwarfFDECache<A>::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {
   pint_t result = 0;
   _LIBUNWIND_LOG_IF_FALSE(_lock.lock_shared());
   for (entry *p = _buffer; p < _bufferUsed; ++p) {

@alexrp alexrp changed the title [libunwind] Fix return type of DwarfFDECache::find() in definition [libunwind] Fix return type of DwarfFDECache::findFDE() in definition Jun 30, 2025
@alexrp alexrp force-pushed the libunwind-findfde-build-fix branch from e07d50b to bd8a55f Compare June 30, 2025 04:40
Copy link

github-actions bot commented Jun 30, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@alexrp alexrp force-pushed the libunwind-findfde-build-fix branch from bd8a55f to 3600ba7 Compare June 30, 2025 04:46
Needed to resolve this compilation error on some systems:

        lib/libunwind/src/UnwindCursor.hpp:153:38: error: return type of out-of-line definition of 'libunwind::DwarfFDECache::findFDE' differs from that in the declaration
    typename A::pint_t DwarfFDECache<A>::findFDE(pint_t mh, pint_t pc) {
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        lib/libunwind/src/libunwind.cpp:31:10: note: in file included from lib/libunwind/src/libunwind.cpp:31:
    #include "UnwindCursor.hpp"
             ^
        lib/libunwind/src/UnwindCursor.hpp:100:17: note: previous declaration is here
      static pint_t findFDE(pint_t mh, pint_t pc);
             ~~~~~~~^
@alexrp alexrp force-pushed the libunwind-findfde-build-fix branch from 3600ba7 to e7bf9cb Compare July 1, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants