On Friday 2014-10-03 15:16, Peter Stuge wrote:
- Firmware builds with no talloc
That may be the use case, but it is not what was implemented.
Why don't you look into fixing that
Why should I?
Because you seem to be working with this part of the code now and you might as well do a thorough job if you're spending time on it.
I am not going to sprinkle osmocore with defines or otherwise make talloc pluggable/replaceable by some other set of allocation functions. I came to fix the problem I have an interest in, and that is making osmocore support a system talloc in lieu or in addition to a bundled talloc (-> http://fedoraproject.org/wiki/Packaging:No_Bundled_Libraries), exercising standard diliegence, which includes that previously supported cases continue to function to the best of observation.
+++ b/tests/msgfile/msgfile_test.c @@ -20,6 +20,7 @@ */
#include <osmocom/core/msgfile.h> +#include <osmocom/core/talloc.h>
Is this hunk needed?
Yes, because system talloc has a #define talloc_free(ctx) _talloc_free(ctx, __location__) and otherwise, one gets "implicit definition of talloc_free" and "undefined reference to `talloc_free'".
Dude, that is a kludge at a callsite, as opposed to a proper dependency fix. Try again.
Here's a hint at least: Think about symmetry and dependency.
I have no idea what you mean by that. Talk code, not riddles. Other code also uses #include <osmocore/core/talloc.h>, so it does not seem too far-fetched to use the exact line to support the case of multiple talloc configurations.