3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-08-03 04:33:28 +00:00

Use macros to disable semi-colon warnings for blocks of macros. (#10192)

This is another PR towards the goal of getting Z3 to compile cleanly
when included via FetchContents into clang-tidy, which uses a pretty
strict set of warnings.

This PR completes the job started by
https://github.com/Z3Prover/z3/pull/10169. It adds `-Wextra-semi` to the
set of CLANG_ONLY_WARNINGS, and adds
```
START_DISABLE_EXTRA_SEMI_WARNING;
...macro invocations with trailing semis...
END_DISABLE_WARNING;
```
around all the blocks of macro invocations that provoked warnings.

(Additionally, in realclosure.h, there was one block of macro
invocations that did *not* follow the trailing-semi pattern; changed
that to look like all the others).
This commit is contained in:
davedets 2026-07-22 18:01:50 -07:00 committed by GitHub
parent f8f763bdf1
commit 35b0b42d2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 107 additions and 5 deletions

View file

@ -19,6 +19,7 @@ Notes:
#pragma once
#include "util/rational.h"
#include "util/manage_warnings.h"
#include "util/mpq.h"
#include "math/polynomial/polynomial.h"
#include "util/z3_exception.h"
@ -431,12 +432,14 @@ AN_MK_COMPARISON_CORE(EXTERNAL, INTERNAL, int) \
AN_MK_COMPARISON_CORE(EXTERNAL, INTERNAL, mpz) \
AN_MK_COMPARISON_CORE(EXTERNAL, INTERNAL, mpq)
START_DISABLE_EXTRA_SEMI_WARNING;
AN_MK_COMPARISON(operator==, eq);
AN_MK_COMPARISON(operator!=, neq);
AN_MK_COMPARISON(operator<, lt);
AN_MK_COMPARISON(operator<=, le);
AN_MK_COMPARISON(operator>, gt);
AN_MK_COMPARISON(operator>=, ge);
END_DISABLE_WARNING;
#undef AN_MK_COMPARISON
#undef AN_MK_COMPARISON_CORE

View file

@ -28,6 +28,7 @@ Notes:
#include "math/interval/interval.h"
#include "util/z3_exception.h"
#include "util/rlimit.h"
#include "util/manage_warnings.h"
namespace realclosure {
class num;
@ -339,12 +340,14 @@ RCF_MK_COMPARISON_CORE(EXTERNAL, INTERNAL, int) \
RCF_MK_COMPARISON_CORE(EXTERNAL, INTERNAL, mpz) \
RCF_MK_COMPARISON_CORE(EXTERNAL, INTERNAL, mpq)
START_DISABLE_EXTRA_SEMI_WARNING;
RCF_MK_COMPARISON(operator==, eq);
RCF_MK_COMPARISON(operator!=, neq);
RCF_MK_COMPARISON(operator<, lt);
RCF_MK_COMPARISON(operator<=, le);
RCF_MK_COMPARISON(operator>, gt);
RCF_MK_COMPARISON(operator>=, ge);
END_DISABLE_WARNING;
#undef RCF_MK_COMPARISON
#undef RCF_MK_COMPARISON_CORE
@ -364,10 +367,12 @@ RCF_MK_BINARY_CORE(EXTERNAL, INTERNAL, int) \
RCF_MK_BINARY_CORE(EXTERNAL, INTERNAL, mpz) \
RCF_MK_BINARY_CORE(EXTERNAL, INTERNAL, mpq)
RCF_MK_BINARY(operator+, add)
RCF_MK_BINARY(operator-, sub)
RCF_MK_BINARY(operator*, mul)
RCF_MK_BINARY(operator/, div)
START_DISABLE_EXTRA_SEMI_WARNING;
RCF_MK_BINARY(operator+, add);
RCF_MK_BINARY(operator-, sub);
RCF_MK_BINARY(operator*, mul);
RCF_MK_BINARY(operator/, div);
END_DISABLE_WARNING;
#undef RCF_MK_BINARY
#undef RCF_MK_BINARY_CORE