Add PUFFS_IGNORE_POTENTIALLY_UNUSED_VARIABLE.

This commit is contained in:
Nigel Tao committed 2017-09-22 12:00:14 +10:00
1 parent 18e32d61e5
commit fda696bf95
6 files changed
+16 -20

No files matched your search

+1 -2
View File
@@ -199,8 +199,7 @@ func (g *gen) writeStatement(b *buffer, n *a.Node, depth uint32) error {
// TODO: remove this.
if n.XType().Decorator().Key() == t.KeyColon {
b.printf("\n/* Avoid the \"unused variable\" warning. */\n")
b.printf("if (%s%s.ptr) {}\n", vPrefix, n.Name().String(g.tm))
b.printf("PUFFS_IGNORE_POTENTIALLY_UNUSED_VARIABLE(%s%s);\n", vPrefix, n.Name().String(g.tm))
}
}
return nil