summaryrefslogtreecommitdiff
path: root/tools/mpfrlint
diff options
context:
space:
mode:
authorvlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-17 06:46:27 +0000
committervlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4>2017-05-17 06:46:27 +0000
commit333fbb5406fb39ddf65fce8f24b98c2fe83795ff (patch)
treec88e9d456c7bc628616ff289ee7dfa3feca2bcea /tools/mpfrlint
parent43f0469ecf0d1375272bdc132152b1f9ec528836 (diff)
downloadmpfr-333fbb5406fb39ddf65fce8f24b98c2fe83795ff.tar.gz
[tools/mpfrlint] In the detection of reserved macro names, skip ERR
from src/mpfr-gmp.h (this is a special case). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@11485 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'tools/mpfrlint')
-rwxr-xr-xtools/mpfrlint14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/mpfrlint b/tools/mpfrlint
index b80b58c2f..91a75da94 100755
--- a/tools/mpfrlint
+++ b/tools/mpfrlint
@@ -118,11 +118,15 @@ srctests=({src,tests}/**/*.[ch]~*mini-gmp.*)
# be used everywhere in the MPFR code. This particularly concerns
# macros defined via mpfr-impl.h or mpfr-test.h, which are included
# in almost every tests.
-err-if-output \
- --msg="ISO C 7.1.3 (Reserved identifiers) and 7.31 (Future library directions)." \
- "reserved identifiers (macro names)" grep -E \
- '# *define (E[0-9A-Z]|FE_[A-Z]|LC_[A-Z]|(PRI|SCN)[Xa-z]|SIG_?[A-Z]|TIME_[A-Z])' \
- $srctests
+#
+# The case of EXP in src/mpfr-gmp.h is not really fixable due to the
+# possible use of gmp-impl.h, but we should make sure that <errno.h>
+# is never included in this case (see comment in the code).
+names='E[0-9A-Z]|FE_[A-Z]|LC_[A-Z]|(PRI|SCN)[Xa-z]|SIG_?[A-Z]|TIME_[A-Z]'
+msg='ISO C 7.1.3 (Reserved identifiers) and 7.31 (Future library directions).'
+grep -E "# *define ($names)" $srctests | \
+ grep -v 'src/mpfr-gmp.h:#define EXP(' | \
+ err-if-output --msg="$msg" "reserved identifiers (macro names)" cat
# Detect the possible use of forbidden macros in mpfr.h, such as those
# starting with "HAVE_" or "WANT_". Public macros defined by MPFR must