From da9eec6aa0fc0f6c29f2c3fdb08bd45ba9c27808 Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Mon, 29 Jul 2013 16:08:45 -0400 Subject: Fix numerous compiler warnings on various platforms --- src/expr/metakind_template.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/expr/metakind_template.h') diff --git a/src/expr/metakind_template.h b/src/expr/metakind_template.h index 8486e8ec3..41813abde 100644 --- a/src/expr/metakind_template.h +++ b/src/expr/metakind_template.h @@ -270,6 +270,13 @@ inline void NodeValueConstPrinter::toStream(std::ostream& out, TNode n) { toStream(out, n.d_nv); } +// The reinterpret_cast of d_children to various constant payload types +// in deleteNodeValueConstant(), below, can flag a "strict aliasing" +// warning; it should actually be okay, because we never access the +// embedded constant as a NodeValue* child, and never access an embedded +// NodeValue* child as a constant. +#pragma GCC diagnostic ignored "-Wstrict-aliasing" + /** * Cleanup to be performed when a NodeValue zombie is collected, and * it has CONSTANT metakind. This calls the destructor for the underlying @@ -289,6 +296,9 @@ ${metakind_constDeleters} } } +// re-enable the strict-aliasing warning +# pragma GCC diagnostic warning "-Wstrict-aliasing" + inline unsigned getLowerBoundForKind(::CVC4::Kind k) { static const unsigned lbs[] = { 0, /* NULL_EXPR */ @@ -334,7 +344,7 @@ ${metakind_operatorKinds} }/* CVC4::kind namespace */ -#line 338 "${template}" +#line 348 "${template}" namespace theory { -- cgit v1.2.3