From 574780b002d00a4af293b05dfa16c5d64992670b Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Mon, 2 Jul 2018 16:24:52 +0200 Subject: 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. --- pkg/csource/csource.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/csource') 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 { -- cgit mrf-deployment