diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2010-12-10 05:35:53 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2010-12-10 05:35:53 -0500 |
commit | e6a3e0451a21fc1b5f248f5f2bcbbacf5e905d68 (patch) | |
tree | 0bd2a55a2ecab3167e147a285c3fde7c6364ba99 | |
parent | a102ad0bec1434d9766cd6b35ba4c0cf174ef52f (diff) | |
download | deheader-e6a3e0451a21fc1b5f248f5f2bcbbacf5e905d68.tar.gz deheader-e6a3e0451a21fc1b5f248f5f2bcbbacf5e905d68.tar.bz2 deheader-e6a3e0451a21fc1b5f248f5f2bcbbacf5e905d68.tar.xz deheader-e6a3e0451a21fc1b5f248f5f2bcbbacf5e905d68.zip |
Test for access() needing <unistd.h>.
-rw-r--r-- | Makefile | 2 | ||||
-rwxr-xr-x | deheader | 1 | ||||
-rw-r--r-- | test/access.c | 20 | ||||
-rw-r--r-- | test/regress.chk | 7 |
4 files changed, 28 insertions, 2 deletions
@@ -14,7 +14,7 @@ deheader.html: deheader.xml xmlto html-nochunks deheader.xml clean: - rm -f *~ *.1 *.html test/*.o MANIFEST SHIPPER.* + rm -f *~ *.1 *.html test/*.o test/*~ MANIFEST SHIPPER.* regress: @echo "Testing deheader: no output is good news." @@ -42,6 +42,7 @@ version = "0.3" requirements = map(lambda (r, h): (re.compile(r), h), ( (r"a64l\s*\(", "<stdlib.h>"), (r"l64a\s*\(", "<stdlib.h>"), + (r"access\s*\(", "<unistd.h>"), (r"umask\s*\(", "<sys/stat.h>|<sys/types.h>"), (r"<sys/socket.h>", "<sys/stat.h>|<sys/types.h>"), )) diff --git a/test/access.c b/test/access.c new file mode 100644 index 0000000..7307fd5 --- /dev/null +++ b/test/access.c @@ -0,0 +1,20 @@ +/* access() requires <stdlib.h> */ + +/* + * Items: access( + * Requires: <stdlib.h> + * Standardized-By: SuS + * Not-Detected-by: gcc-4.4.3 + Linux + */ + +#include <unistd.h> + +main(int arg, char **argv) +{ + /* + * Note: use of a symbolic constant like F_OK *will* + * cause the compile to fail and the requrement + * for <unistd.h> to be tetected. + */ + (void)access("/dev/null", 0); +} diff --git a/test/regress.chk b/test/regress.chk index 9d17e27..8135ba7 100644 --- a/test/regress.chk +++ b/test/regress.chk @@ -12,11 +12,16 @@ deheader: test/a64l.c includes <stdlib.h> deheader: test/a64l.c has requires <stdlib.h> from a64l\s*\( deheader: test/a64l.c has requires <stdlib.h> from l64a\s*\( deheader: test/abs.c includes <stdlib.h> +deheader: test/access.c has requires <unistd.h> from access\s*\( +deheader: test/access.c has requires <unistd.h> from access\s*\( +deheader: test/access.c includes <unistd.h> +deheader: test/access.c has requires <unistd.h> from access\s*\( deheader: test/abort.c includes <stdlib.h> deheader: test/string.c without <string.h> succeeded. deheader: remove <string.h> from test/string.c deheader: test/abs.c without <stdlib.h> succeeded. deheader: remove <stdlib.h> from test/abs.c +deheader: in test/access.c, retaining required '#include <unistd.h>\n' deheader: in test/a64l.c, retaining required '#include <stdlib.h>\n' deheader: test/abort.c without <stdlib.h> succeeded. deheader: remove <stdlib.h> from test/abort.c @@ -26,4 +31,4 @@ deheader: remove <stdio.h> from test/duplicate.c deheader: remove <stdio.h> from test/duplicate.c deheader: in test/umask.c, retaining required '#include <sys/types.h>\n' deheader: in test/umask.c, retaining required '#include <sys/stat.h>\n' -deheader: saw 7 files, 8 includes, 5 removed +deheader: saw 8 files, 9 includes, 5 removed |