Date: Tue, 4 Aug 1998 23:35:00 +1000 From: Bruce Evans <bde@zeta.org.au> To: bde@zeta.org.au, dag-erli@ifi.uio.no Cc: bde@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc_r/man pthread_cleanup_push.3 pthread_cond_init.3 pthread_mutex_init.3 Message-ID: <199808041335.XAA04000@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>> > > Changed prototype in synopsis to match prototype in <pthread.h>.
>> > What about -stable?
>> I don't run -stable, and only commit fixes for serious bugs to it.
>
>*groan*
>
>I'll do it.
Don't forget the other man page synopsis bugs that I just fixed :-).
Some interfaces are different in -stable, so man page changes can't be
applied blindly.
Here is the too-simple synopsis checker that I used to find the bugs.
It currently finds problems in only 198 man pages in -current (mostly
for .Fn abused for macros, and many duplicates for links).
#!/bin/sh
# XXX this writes too much in /tmp.
# XXX preparation: cp vnode_if.h from somewhere to /tmp.
cd /usr/share/man
for i in `find . -name '*.gz' -links +0 | xargs zegrep -l '(\.Fn|#include)'`
do
zcat $i |
awk -v file=$i '
BEGIN {
print ".Dd"
print ".Sh SYNOPSIS"
ft = ""
if (index(file, ".9.gz") != 0)
print ".Fd #define KERNEL 1"
printf "" > "/tmp/zFnlist"
}
/^\.Fd/ { print $0 }
/^\.Ft/ { ft = $0 }
/^(\.Fn.*"|\.Fn.* void)/ {
print $2 > "/tmp/zFnlist"
print ".Fd #undef " $2
print ft
ft = ""
print $0
# Print semicolon on a separate line to avoid too many args.
print ";"
}
/^\.Fo/ {
print $2 > "/tmp/zFnlist"
print ".Fd #undef " $2
print ft
ft = ""
print $0
while (getline >= 0 && index($0, ".Fc") != 1)
print $0
print ".Fc"
# Print semicolon on a separate line to avoid too many args.
print ";"
}
# /^[ \t]*#include/ { print ".Fd " $1 " " $2 }
END { print "int pedantic_pacificer;" }
' |
nroff -mandoc |
sed -e 's/.//g' -e 's/^[ ]*//' -e '/^$/d' -e '/^SYNOPSIS$/d' |
tr '\012' '@' |
sed -e 's/@@//g' |
tr '@' '\012' > /tmp/z.c
# Here -I /sys is for <scsi/something.h>, and -I /usr/include is
# before that to avoid a bugfeature in gcc: warnings for `long long'
# are apparently suppressed if long long is used in headers in
# standard places, but not if it is used elsewhere.
if cc -ansi -pedantic -Werror -I /tmp -I /usr/include -I /sys -S \
-o /dev/null /tmp/z.c >/dev/null 2>&1
then
expect=`sort < /tmp/zFnlist`
sedcmd="s/.*\`\(.*\)'.*/\1/"
got=`cc -Wredundant-decls -I /tmp -I /usr/include -I /sys -S \
-o /dev/null /tmp/z.c 2>&1 |
grep redundant |
sed $sedcmd |
sort`
if test "$expect" != "$got"
then
echo expect \"$expect\", got \"$got\"
echo $i bad
mv /tmp/z.c /tmp/`basename $i .gz`.c
fi
else
echo $i bad
mv /tmp/z.c /tmp/`basename $i .gz`.c
fi
done
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808041335.XAA04000>
