diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2019-03-21 13:17:23 +0100 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2019-03-21 13:27:41 +0100 |
| commit | 44270612b458144e4c3e881bac376d32bb395ee8 (patch) | |
| tree | 9dee8506297bc249f11073feebfad12b2e0f2fea /executor/common.h | |
| parent | 2dadc32780468044e81e77814e1f1969373f9c69 (diff) | |
executor: prevent non-null expected warnings
The added test triggers warnings like these:
<stdin>: In function ‘syz_mount_image.constprop’:
<stdin>:298:3: error: argument 1 null where non-null expected [-Werror=nonnull]
In file included from <stdin>:26:0:
/usr/include/x86_64-linux-gnu/sys/stat.h:320:12: note: in a call to function ‘mkdir’ declared here
extern int mkdir (const char *__path, __mode_t __mode)
^~~~~
cc1: all warnings being treated as errors
<stdin>: In function ‘syz_open_procfs.constprop’:
<stdin>:530:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=]
<stdin>:85:110: note: in definition of macro ‘NONFAILING’
<stdin>:532:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=]
<stdin>:85:110: note: in definition of macro ‘NONFAILING’
<stdin>:534:41: error: ‘%s’ directive argument is null [-Werror=format-truncation=]
<stdin>:85:110: note: in definition of macro ‘NONFAILING’
Use volatile for all arguments of syz_ functions to prevent
compiler from treating the arguments as constants in reproducers.
Popped up during bisection that used a repro that previously worked.
Update #501
Diffstat (limited to 'executor/common.h')
| -rw-r--r-- | executor/common.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/executor/common.h b/executor/common.h index 1d4d1883c..9531d4a3e 100644 --- a/executor/common.h +++ b/executor/common.h @@ -381,7 +381,7 @@ static uint16 csum_inet_digest(struct csum_inet* csum) #if SYZ_EXECUTOR || __NR_syz_execute_func // syz_execute_func(text ptr[in, text[taget]]) -static long syz_execute_func(long text) +static long syz_execute_func(volatile long text) { ((void (*)(void))(text))(); return 0; |
