summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2024-01-30 14:59:59 -0500
committerJakob Kaivo <jkk@ung.org>2024-01-30 14:59:59 -0500
commit7f9129145f2293cb8c9052ff1f395226421b0ae4 (patch)
treeb42f501b25082853d7bc2eb67fadd73e10568c74 /scripts
parentcc6e7378d3f5473137e0c46d39173e6f60dcefda (diff)
check headers for standard declarations
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/check.sh10
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/check.sh b/scripts/check.sh
index 0231db1a..af7e50d9 100755
--- a/scripts/check.sh
+++ b/scripts/check.sh
@@ -1,7 +1,7 @@
#!/bin/sh
check_standard() {
- if ! (grep -q -F -e 'STDC(' -e 'POSIX(' -e 'XOPEN(' "$1"); then
+ if ! (grep -q -F -e 'STDC(' -e 'CEXT1(' -e 'POSIX(' -e 'XOPEN(' "$1"); then
printf '%s has no standard declaration\n' "$1"
fi
}
@@ -18,16 +18,18 @@ check_signal_safety() {
check_file() {
check_standard $1
- check_signal_safety $1
+ if (echo $1 | grep -q '\.c$'); then
+ check_signal_safety $1
+ fi
}
if [ $# -eq 0 ]; then
DIR=$(dirname $0)/../src
- find "${DIR}" -name \*.c -exec sh $0 {} + | sed -e "s#^${DIR}#src#g"
+ find "${DIR}" -name \*.[ch] -exec sh $0 {} + | sed -e "s#^${DIR}#src#g"
else
while [ $# -gt 0 ]; do
if [ -d $1 ]; then
- find "$1" -name \*.c -exec sh $0 {} +
+ find "$1" -name \*.[ch] -exec sh $0 {} +
else
check_file $1
fi