Skip to content

Commit

Permalink
pkg/csource: prevent unused-result warnings
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dvyukov committed Jul 2, 2018
1 parent 7c4a6f6 commit 574780b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/csource/csource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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 {
Expand Down

0 comments on commit 574780b

Please sign in to comment.