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

June 2025

S M T W T F S
1234567
891011121314
15161718192021
22 23242526 2728
2930     

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 8th, 2025 02:59 pm
Powered by Dreamwidth Studios