lol

tilem: add gcc14 patch

The patch fixes a bug with the allocation of a new Tilem macro action:
instead of allocating the macro action itself, the code allocates a
string for holding the macro value. This happens to work if the length
of `value` is greater than the size of TilemMacroAtom since pointers
returned from malloc can be used for anything.

+14
+13
pkgs/by-name/ti/tilem/gcc14-fix.patch
··· 1 + diff --git a/gui/macro.c b/gui/macro.c 2 + index ae8db8b..226d48f 100644 3 + --- a/gui/macro.c 4 + +++ b/gui/macro.c 5 + @@ -86,7 +86,7 @@ void tilem_macro_add_action(TilemMacro* macro, int type, char * value) { 6 + macro->actions = tilem_macro_actions_new(macro, n + 1); 7 + 8 + /* Then we need to save the action */ 9 + - macro->actions[n] = g_new(char, strlen(value)); /* FIXME : gcc says : "assignment from incompatible pointer type" ??? */ 10 + + macro->actions[n] = g_new(TilemMacroAtom, 1); /* FIXME : gcc says : "assignment from incompatible pointer type" ??? */ 11 + macro->actions[n]->value = g_strdup(value); 12 + macro->actions[n]->type = type; 13 + macro->n++;
+1
pkgs/by-name/ti/tilem/package.nix
··· 27 27 libticables2 28 28 libticalcs2 29 29 ]; 30 + patches = [ ./gcc14-fix.patch ]; 30 31 env.NIX_CFLAGS_COMPILE = toString [ "-lm" ]; 31 32 meta = with lib; { 32 33 homepage = "http://lpg.ticalc.org/prj_tilem/";