Aug. 9th, 2021

izard: (Default)
I just lost several hours today debugging the following:

I am linking to a library that has a function declared in a header as:
MACRO_EXPANDING_TO_RETURN_TYPE create_object_pointer(uint64_t* arg1, int arg2, int arg3);

I can’t include the corresponding header, so just cut&pasted the function declaration before use as:
extern
MACRO_EXPANDING_TO_RETURN_TYPE create_object_pointer(uint64_t* arg1, int arg2, int arg3);

Then I was calling it in my code:
return another_lib_func (create_object_pointer(arg1, arg2, arg3), “PASSING RESULT FROM lib_func");

another_lib_func is:
int another_lib_func(RETURN_TYPE t, String s)
{
If (t == NULL) return -1;
If (t->value < 0) return -1;
….
}

It segfaulted in another_lib_func, at second line. Why?
Read more... )

Profile

izard: (Default)
izard

August 2025

S M T W T F S
     12
3456789
10111213 141516
17181920212223
24252627282930
31      

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 24th, 2025 06:08 pm
Powered by Dreamwidth Studios