From 802705523a89a4675c91a389e2ac5305a29e2ed0 Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 30 Nov 2021 09:58:39 +0000 Subject: 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). --- executor/style_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'executor') 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) -- cgit mrf-deployment