Skip to content

Commit e074796

Browse files
committed
chore(driver/bpf): fix warning in bpf_accumulate_argv_or_env
Recent versions of clang tend to emit the following warning: In file included from /usr/src/draios-agent-14.2.4/bpf/probe.c:26: /usr/src/draios-agent-14.2.4/bpf/fillers.h:2311:48: warning: passing 'volatile long *' to parameter of type 'long *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 2311 | res = bpf_accumulate_argv_or_env(data, argv, &args_len); | ^~~~~~~~~ /usr/src/draios-agent-14.2.4/bpf/fillers.h:1921:61: note: passing argument to parameter 'args_len' here 1921 | long *args_len) { | ^ Jut make the (other) variable and the argument volatile. Signed-off-by: Gerlando Falauto <[email protected]>
1 parent 28a58d5 commit e074796

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

driver/bpf/fillers.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,7 +1954,7 @@ static __always_inline int bpf_append_cgroup(struct task_struct *task, char *buf
19541954

19551955
static __always_inline int bpf_accumulate_argv_or_env(struct filler_data *data,
19561956
char **argv,
1957-
long *args_len) {
1957+
volatile long *args_len) {
19581958
char *arg;
19591959
int off;
19601960
int len;
@@ -2616,7 +2616,7 @@ FILLER(proc_startupdate_3, true) {
26162616
/*
26172617
* execve family parameters.
26182618
*/
2619-
long env_len = 0;
2619+
volatile long env_len = 0;
26202620
kuid_t loginuid;
26212621
uint32_t tty;
26222622
struct file *exe_file;

0 commit comments

Comments
 (0)