diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-06-13 17:21:33 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-06-13 17:21:33 +0200 |
| commit | 47be383ea0d2fd1008fa37be6695634fe17ad805 (patch) | |
| tree | 7843b132a242f4ecc0cfdebe6ad2d7f6d30ece53 /csource/csource.go | |
| parent | 88ccde80d3ea11c2e00c98ba833824ec565edcc3 (diff) | |
executor: fix clang-tidy warnings
A single check is enabled for now (misc-definitions-in-headers).
But it's always fixable and found 2 bugs in csource.
Diffstat (limited to 'csource/csource.go')
| -rw-r--r-- | csource/csource.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/csource/csource.go b/csource/csource.go index 6caac68bf..db610ce2e 100644 --- a/csource/csource.go +++ b/csource/csource.go @@ -175,6 +175,10 @@ func Write(p *prog.Prog, opts Options) ([]byte, error) { func generateTestFunc(w io.Writer, opts Options, calls []string, name string) { if !opts.Threaded && !opts.Collide { fmt.Fprintf(w, "void %v()\n{\n", name) + if opts.Debug { + // Use debug to avoid: error: ‘debug’ defined but not used. + fmt.Fprintf(w, "\tdebug(\"%v\\n\");\n", name) + } if opts.Repro { fmt.Fprintf(w, "\tsyscall(SYS_write, 1, \"executing program\\n\", strlen(\"executing program\\n\"));\n") } @@ -198,6 +202,10 @@ func generateTestFunc(w io.Writer, opts Options, calls []string, name string) { fmt.Fprintf(w, "\tlong i;\n") fmt.Fprintf(w, "\tpthread_t th[%v];\n", 2*len(calls)) fmt.Fprintf(w, "\n") + if opts.Debug { + // Use debug to avoid: error: ‘debug’ defined but not used. + fmt.Fprintf(w, "\tdebug(\"%v\\n\");\n", name) + } if opts.Repro { fmt.Fprintf(w, "\tsyscall(SYS_write, 1, \"executing program\\n\", strlen(\"executing program\\n\"));\n") } @@ -387,7 +395,7 @@ func preprocessCommonHeader(opts Options, handled map[string]int, useBitmasks, u if useBitmasks { defines = append(defines, "SYZ_USE_BITMASKS") } - if useBitmasks { + if useChecksums { defines = append(defines, "SYZ_USE_CHECKSUMS") } switch opts.Sandbox { |
