smatch: 1.73 -> 1.74, fix gcc-15 build (#482799)
This commit is contained in:
@@ -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@");
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user