summaryrefslogtreecommitdiff
path: root/mpfrlint
blob: bfc27545058b699b7f5e8dc8c4480c52a7f58369 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh

# Check possible problems in the MPFR source.

grep '^# *include *<math\.h>' *.c

grep -E 'mpfr_(underflow|overflow|nanflag|inexflag|erangeflag)_p' *.{c,h} | \
  grep -v '^exceptions.c:' | grep -v '^mpfr-impl.h:#define mpfr_.*_p()' | \
  grep -v '^mpfr.h:__MPFR_DECLSPEC '

fdlv1="`sed -n '/Version / {s/.*Version //; s/,.*//; p; q}' fdl.texi`"
fdlv2="`sed -n '/GNU Free Documentation License/ \
  {s/.*Version //; s/ or.*//; p; q}' mpfr.texi`"
[ "x$fdlv1" = "x$fdlv2" ] || cat <<EOF
GFDL versions differ:
   fdl.texi: $fdlv1
  mpfr.texi: $fdlv2
EOF

# Note: if paragraphs are reformatted, this may need to be updated.
lgpl="`sed -n '/Version [0-9.]\+ or any later version/ \
  {s/.*Version //; s/ or.*//; p; q}' mpfr.texi`"
for file in {,tests/}*.{c,h}
do
  if grep -q "MPFR Library" "$file"; then
    grep -q "either version $lgpl of the License" "$file" || \
      echo "Possibly missing or incorrect copyright notice in $file"
  fi
done

true