summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-07-02 09:57:16 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2014-07-02 09:57:16 +0000
commit4ee70bd35959ae283a2e4db373f87f3244a20531 (patch)
tree047843228e24357aaf7fa6d93ff5d64a3e71a573 /tools
parentdb63cb6cc98ba73a9676b0a42148604a94ee2709 (diff)
downloadmpfr-4ee70bd35959ae283a2e4db373f87f3244a20531.tar.gz
[tools/mpfrlint] Detect the possible use of forbidden macros in mpfr.h.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9128 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tools')
-rwxr-xr-xtools/mpfrlint9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/mpfrlint b/tools/mpfrlint
index 553a3b26d..86fc54ff3 100755
--- a/tools/mpfrlint
+++ b/tools/mpfrlint
@@ -6,6 +6,15 @@
dir=`pwd`
[ -d src ] || [ "`basename "$dir"`" != tools ] || cd ..
+# Detect the possible use of forbidden macros in mpfr.h, such as those
+# starting with "HAVE_" or "WANT_". Public macros defined by MPFR must
+# start with "MPFR_".
+perl -ne '/^#/ && ! /^# *error / or next; while (/\b([_A-Z]+)\b/g)
+ { my $m = $1;
+ $m =~ /^(_*MPFR_|_*GMP_|__(GNUC|ICC|STDC)(_|$)|_MSC_|U?INTMAX_C$)/
+ and next;
+ print "Forbidden macro in mpfr.h line $.: $m\n" }' src/mpfr.h
+
grep '^# *include *<math\.h>' src/*.c
flaglist="underflow|overflow|divby0|nanflag|inexflag|erangeflag"