diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2021-11-30 09:58:39 +0000 |
|---|---|---|
| committer | Aleksandr Nogikh <wp32pw@gmail.com> | 2021-11-30 11:36:40 +0100 |
| commit | 802705523a89a4675c91a389e2ac5305a29e2ed0 (patch) | |
| tree | 7ccdbc5375fad70a715fb7fd162b45907cf5ecba /executor | |
| parent | d0830353e30438120e98eb8b8c4c176095093fad (diff) | |
executor: add an ifdef SYZ_* style check
SYZ_* constants are always defined and one must not check them via
ifdef. Add a check to prevent such problems during development (inspired
by the discussion in #2882).
Diffstat (limited to 'executor')
| -rw-r--r-- | executor/style_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/executor/style_test.go b/executor/style_test.go index 5c393ea3d..3bb581886 100644 --- a/executor/style_test.go +++ b/executor/style_test.go @@ -141,6 +141,14 @@ if (foo) { `failmsg("format %s string", "format")`, }, }, + { + pattern: `ifn?def\s+SYZ_`, + message: "SYZ_* are always defined, use #if instead of #ifdef", + tests: []string{ + `#ifndef SYZ_EXECUTOR_USES_FORK_SERVER`, + `#ifdef SYZ_EXECUTOR_USES_FORK_SERVER`, + }, + }, } for _, check := range checks { re := regexp.MustCompile(check.pattern) |
