_AddressOfReturnAddress Error!

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
Posts: 10
Joined: May 06, 2022 12:43

_AddressOfReturnAddress Error!

Post by MOODSKY2002 »

fake:(.text+0x504a): undefined reference to `_AddressOfReturnAddress'

Which static library should be referenced to use this function?

I tried libclangBasic. a of msys2 and still reported an error
LibclangBasic of msys2 A Ver (GCC: (Rev10, Build by MSYS2 project) 11.2.0) This FB109 Ver (GCC: (MinGW-W64 x86_64 posix sjlj, build by Brecht Sanders) 9.3.0)
Posts: 7993
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: _AddressOfReturnAddress Error!

Post by dodicat »

It is declared OK, but it seems to have no actual implementation.
I would call this an intrinsic or just plain bonkers.
The closest I can find (for -gen gcc ) is

Code: Select all

extern "c"
declare function address alias "__builtin_return_address"(as ulong) as any ptr
end extern

print address(0)

function start() as any ptr
print address(1)'= address(0) in main module
print __FUNCTION__
print "Press a key to end"
return address(0) 
end function

dim as function() as any ptr fp= @start
Post Reply