From 9c777dfe8301cc0088917e35333d7db0064d68c8 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 18 Aug 2001 11:55:52 +0000 Subject: Update. 2001-08-18 Ulrich Drepper * conform/conformtest.pl: Change namespace test to take #undef lines into account. * conform/data/netinet/in.h-data: Fix typo in allow-header line. * conform/data/sys/socket.h-data: Add sockatmark. --- conform/conformtest.pl | 53 ++++++++++++++++++++++++++++++------------ conform/data/netinet/in.h-data | 2 +- conform/data/sys/socket.h-data | 1 + 3 files changed, 40 insertions(+), 16 deletions(-) (limited to 'conform') diff --git a/conform/conformtest.pl b/conform/conformtest.pl index 5ae1cea45a..364e34d2a4 100644 --- a/conform/conformtest.pl +++ b/conform/conformtest.pl @@ -224,11 +224,19 @@ sub newtoken { if ($isknown{$token}) { ++$nknown; } else { - ++$nerrors; - if ($nerrors == 1) { - printf ("FAIL\n " . "-" x 72 . "\n"); - } - printf (" Namespace violation: \"%s\"\n", $token); + $errors{$token} = 1; + } +} + + +sub removetoken { + my($token) = @_; + my($idx); + + return if ($token =~ /^[0-9_]/ || $iskeyword{$token}); + + if (exists $errors{$token}) { + undef $errors{$token}; } } @@ -243,14 +251,15 @@ sub checknamespace { print TESTFILE "#include <$h>\n"; close (TESTFILE); - $nerrors = 0; + undef %errors; $nknown = 0; open (CONTENT, "$CC $CFLAGS{$dialect} -E $fnamebase.c -P -Wp,-dN | sed -e '/^# [1-9]/d' -e '/^[[:space:]]*\$/d' |"); loop: while () { - next loop if (/^#undef /); chop; if (/^#define (.*)/) { newtoken ($1, @allow); + } elsif (/^#undef (.*)/) { + removetoken ($1); } else { # We have to tokenize the line. my($str) = $_; @@ -266,14 +275,28 @@ sub checknamespace { } close (CONTENT); unlink "$fnamebase.c"; - if ($nerrors != 0) { - printf (" " . "-" x 72 . "\n"); - ++$errors; - } elsif ($nknown > 0) { - printf ("EXPECTED FAILURES\n"); - ++$known; - } else { - printf ("OK\n"); + $realerror = 0; + if ($#errors != 0) { + foreach $f (%errors) { + if ($errors{$f} == 1) { + if ($realerror == 0) { + printf ("FAIL\n " . "-" x 72 . "\n"); + $realerror = 1; + ++$errors; + } + printf (" Namespace violation: \"%s\"\n", $f); + } + } + printf (" " . "-" x 72 . "\n") if ($realerror != 0); + } + + if ($realerror == 0) { + if ($nknown > 0) { + printf ("EXPECTED FAILURES\n"); + ++$known; + } else { + printf ("OK\n"); + } } } diff --git a/conform/data/netinet/in.h-data b/conform/data/netinet/in.h-data index 9b7d05e821..1f1955d1a6 100644 --- a/conform/data/netinet/in.h-data +++ b/conform/data/netinet/in.h-data @@ -58,7 +58,7 @@ function uint16_t htons (uint16_t) function uint32_t ntohl (uint32_t) function uint16_t ntohs (uint16_t) -allow-header intttypes.h +allow-header inttypes.h allow-header arpa/inet.h constant INET6_ADDRSTRLEN 46 diff --git a/conform/data/sys/socket.h-data b/conform/data/sys/socket.h-data index 151ade5b92..61f30abc82 100644 --- a/conform/data/sys/socket.h-data +++ b/conform/data/sys/socket.h-data @@ -103,6 +103,7 @@ function int setsockopt (int, int, int, const void*, socklen_t) function int shutdown (int, int) function int socket (int, int, int) function int socketpair (int, int, int, int[2]) +function int sockatmark (int) allow-header sys/uio.h -- cgit v1.2.3