diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2020-06-09 00:57:05 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2020-06-09 00:57:05 +0000 |
commit | 49b578c61265818a86648908900046cd65188ff6 (patch) | |
tree | 4e8129e7b13c3f371921315af394297f110bf21c /tune | |
parent | 28da1c273265520eb017a779bbe9ccbe74819a25 (diff) | |
download | mpfr-49b578c61265818a86648908900046cd65188ff6.tar.gz |
Removed MPFR_DECL_STATIC_ASSERT macro as it was buggy, unused, rather
useless, and it had drawbacks. Details:
* In src/mpfr-sassert.h, the default definition of this macro in the
MPFR_USE_STATIC_ASSERT case ended with a spurious ";". Since this
macro was unused, this wasn't noticeable... except in the configure
test for static assertions, which failed in some cases (e.g. with
CFLAGS="-std=c99 -pedantic-errors -Wno-error=overlength-strings")
for this reason, which had the effect to let MPFR_USE_STATIC_ASSERT
undefined, while static assertions were actually working.
* Still in src/mpfr-sassert.h, but when MPFR_USE_STATIC_ASSERT is not
defined, the MPFR_DECL_STATIC_ASSERT(c) expanded to nothing, which
would yield invalid code as
MPFR_DECL_STATIC_ASSERT(some_assertion);
would yield an extra ";" (about the same issue as above). Given
the fact that the portable MPFR_USE_STATIC_ASSERT code does not
work with this compiler, it is not clear whether this is fixable
in a completely reliable way.
* MPFR_DECL_STATIC_ASSERT can be replaced by MPFR_STAT_STATIC_ASSERT
after moving it to the statement section of a function, with almost
no drawbacks (just a bit readability in some cases?).
* When MPFR_USE_STATIC_ASSERT is not defined, MPFR_STAT_STATIC_ASSERT
will check the assertion at run time (for free, since the result is
known at compile time), while MPFR_DECL_STATIC_ASSERT would not be
able to do anything useful.
Changes:
* acinclude.m4: removed the test of MPFR_DECL_STATIC_ASSERT.
* src/mpfr-sassert.h: removed MPFR_DECL_STATIC_ASSERT definitions.
* tune/tuneup.c: removed MPFR_DECL_STATIC_ASSERT redefinition.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13947 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tune')
-rw-r--r-- | tune/tuneup.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/tune/tuneup.c b/tune/tuneup.c index 08cf151e3..2d783f598 100644 --- a/tune/tuneup.c +++ b/tune/tuneup.c @@ -31,9 +31,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "speed.h" /* Undefine static assertion system */ -#undef MPFR_DECL_STATIC_ASSERT #undef MPFR_STAT_STATIC_ASSERT -#define MPFR_DECL_STATIC_ASSERT(a) MPFR_ASSERTN(a) #define MPFR_STAT_STATIC_ASSERT(a) MPFR_ASSERTN(a) int verbose; |