aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2018-07-02 16:24:52 +0200
committerDmitry Vyukov <dvyukov@google.com>2018-07-02 16:24:52 +0200
commit574780b002d00a4af293b05dfa16c5d64992670b (patch)
treef9a911ad190f298a4e94afbe078d6fef322c9aca
parent7c4a6f684cfcb9b525ab44399f0ed8873795e8ff (diff)
pkg/csource: prevent unused-result warnings
Warnings for write unused-result fire on travis, somehow I don't get them locally. Use the result in a fake way to prevent the warning.
-rw-r--r--pkg/csource/csource.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/csource/csource.go b/pkg/csource/csource.go
index aa9972a2a..992e5ac4f 100644
--- a/pkg/csource/csource.go
+++ b/pkg/csource/csource.go
@@ -209,7 +209,7 @@ func (ctx *context) generateTestFunc(calls []string, hasVars bool, name string)
ctx.printf("\tdebug(\"%v\\n\");\n", name)
}
if opts.Repro {
- ctx.printf("\twrite(1, \"executing program\\n\", strlen(\"executing program\\n\"));\n")
+ ctx.printf("\tif (write(1, \"executing program\\n\", strlen(\"executing program\\n\"))) {}\n")
}
for _, c := range calls {
ctx.printf("%s", c)
@@ -235,7 +235,7 @@ func (ctx *context) generateTestFunc(calls []string, hasVars bool, name string)
ctx.printf("\tdebug(\"%v\\n\");\n", name)
}
if opts.Repro {
- ctx.printf("\twrite(1, \"executing program\\n\", strlen(\"executing program\\n\"));\n")
+ ctx.printf("\tif (write(1, \"executing program\\n\", strlen(\"executing program\\n\"))) {}\n")
}
ctx.printf("\texecute(%v);\n", len(calls))
if opts.Collide {