From 6c366be1ab381fc98f7df19eab5ca840d18754f0 Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Thu, 22 Jan 2026 20:39:55 +0000 Subject: [PATCH] smatch: 1.73 -> 1.74 Changes: https://github.com/error27/smatch/compare/1.73...1.74 --- pkgs/by-name/sm/smatch/fix_include_path.patch | 28 +++++----------- pkgs/by-name/sm/smatch/package.nix | 5 ++- pkgs/by-name/sm/smatch/remove_const.patch | 32 ------------------- 3 files changed, 10 insertions(+), 55 deletions(-) delete mode 100644 pkgs/by-name/sm/smatch/remove_const.patch diff --git a/pkgs/by-name/sm/smatch/fix_include_path.patch b/pkgs/by-name/sm/smatch/fix_include_path.patch index af6de589f9e9..8d34fbeea443 100644 --- a/pkgs/by-name/sm/smatch/fix_include_path.patch +++ b/pkgs/by-name/sm/smatch/fix_include_path.patch @@ -1,36 +1,24 @@ -diff --git a/pre-process.c b/pre-process.c -index 457685c0..006209ad 100644 --- a/pre-process.c +++ b/pre-process.c -@@ -2410,32 +2410,27 @@ static void do_preprocess(struct token **list) +@@ -2410,22 +2410,27 @@ static void do_preprocess(struct token **list) void init_include_path(void) { -- FILE *fp; - char path[256]; -- char arch[32]; - char os[32]; +- int error; +- struct utsname name; - -- fp = popen("/bin/uname -m", "r"); -- if (!fp) +- error = uname(&name); +- if (error) - return; -- if (!fgets(arch, sizeof(arch) - 1, fp)) -- return; -- pclose(fp); -- if (arch[strlen(arch) - 1] == '\n') -- arch[strlen(arch) - 1] = '\0'; - -- fp = popen("/bin/uname -o", "r"); -- if (!fp) -- return; -- fgets(os, sizeof(os) - 1, fp); -- pclose(fp); -- -- if (strcmp(os, "GNU/Linux\n") != 0) +- if (strcmp(name.sysname, "Linux") != 0) - return; - strcpy(os, "linux-gnu"); - -- snprintf(path, sizeof(path), "/usr/include/%s-%s/", arch, os); +- snprintf(path, sizeof(path), "/usr/include/%s-%s/", +- name.machine, os); - add_pre_buffer("#add_system \"%s/\"\n", path); + add_pre_buffer("#add_system \"%s/\"\n", "@clang@"); + add_pre_buffer("#add_system \"%s/\"\n", "@libc@"); diff --git a/pkgs/by-name/sm/smatch/package.nix b/pkgs/by-name/sm/smatch/package.nix index 7362d2a8669f..9ebdcc4f0005 100644 --- a/pkgs/by-name/sm/smatch/package.nix +++ b/pkgs/by-name/sm/smatch/package.nix @@ -13,7 +13,7 @@ buildc2xml ? false, }: let - version = "1.73"; + version = "1.74"; in stdenv.mkDerivation (finalAttrs: { pname = "smatch"; @@ -23,11 +23,10 @@ stdenv.mkDerivation (finalAttrs: { owner = "error27"; repo = "smatch"; tag = finalAttrs.version; - hash = "sha256-Pv3bd2cjnQKnhH7TrkYWfDEeaq6u/q/iK1ZErzn6bME="; + hash = "sha256-LZdTwoTbNj/YE8o5xQ7MclkULJI3NTeeR38BsAtsI/4="; }; patches = [ - ./remove_const.patch ( let clang-major = lib.versions.major (lib.getVersion llvmPackages.clang-unwrapped); diff --git a/pkgs/by-name/sm/smatch/remove_const.patch b/pkgs/by-name/sm/smatch/remove_const.patch deleted file mode 100644 index 6f2416d69187..000000000000 --- a/pkgs/by-name/sm/smatch/remove_const.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/smatch.h b/smatch.h -index 36ae3497..ceb1907c 100644 ---- a/smatch.h -+++ b/smatch.h -@@ -1375,7 +1375,7 @@ bool buf_comp_has_bytes(struct expression *buf, struct expression *var); - bool buf_comp2_has_bytes(struct expression *buf_expr, struct expression *var); - - /* smatch_untracked_param.c */ --void mark_untracked(struct expression *expr, int param, const char *key, const char *value); -+void mark_untracked(struct expression *expr, int param, char *key, char *value); - void add_untracked_param_hook(void (func)(struct expression *call, int param)); - void add_lost_param_hook(void (func)(struct expression *call, int param)); - void mark_all_params_untracked(int return_id, char *return_ranges, struct expression *expr); -diff --git a/smatch_untracked_param.c b/smatch_untracked_param.c -index 4bb3c244..d24958e7 100644 ---- a/smatch_untracked_param.c -+++ b/smatch_untracked_param.c -@@ -120,12 +120,12 @@ free: - - } - --void mark_untracked(struct expression *expr, int param, const char *key, const char *value) -+void mark_untracked(struct expression *expr, int param, char *key, char *value) - { - mark_untracked_lost(expr, param, key, UNTRACKED_PARAM); - } - --void mark_lost(struct expression *expr, int param, const char *key, const char *value) -+void mark_lost(struct expression *expr, int param, char *key, char *value) - { - mark_untracked_lost(expr, param, key, LOST_PARAM); - }