From 8ea425573664bbf0bde1c199537cdff04209d586 Mon Sep 17 00:00:00 2001 From: nsz Date: Wed, 14 Sep 2011 15:04:15 +0200 Subject: [PATCH] more precise header errors --- data/musl.problems | 10 ---------- findproblems.sh | 19 +++++++++++++++++-- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/data/musl.problems b/data/musl.problems index 89fd900..dd00d54 100644 --- a/data/musl.problems +++ b/data/musl.problems @@ -2,7 +2,6 @@ nodecl cfmakeraw T nodecl cfsetspeed W nodecl clearerr_unlocked W nodecl crypt_r W -header ctermid unistd.h stdio.h nodecl daemon T nodecl dst_offset V proto encrypt unistd.h void(char*,int) void(char[],int) void encrypt(char *, int); void encrypt(char block[64], int edflag); @@ -23,15 +22,12 @@ header getopt getopt.h unistd.h nodecl getw T nodecl getwc_unlocked W nodecl getwchar_unlocked W -header htonl netinet/in.h arpa/inet.h -header htons netinet/in.h arpa/inet.h header iswalnum wchar.h wctype.h header iswalpha wchar.h wctype.h header iswblank wchar.h wctype.h header iswcntrl wchar.h wctype.h header iswctype wchar.h wctype.h header iswdigit wchar.h wctype.h -header iswdigit wchar.h wctype.h header iswgraph wchar.h wctype.h header iswlower wchar.h wctype.h header iswprint wchar.h wctype.h @@ -39,8 +35,6 @@ header iswpunct wchar.h wctype.h header iswspace wchar.h wctype.h header iswupper wchar.h wctype.h header iswxdigit wchar.h wctype.h -header ntohl netinet/in.h arpa/inet.h -header ntohs netinet/in.h arpa/inet.h header optarg getopt.h unistd.h header opterr getopt.h unistd.h header optind getopt.h unistd.h @@ -59,9 +53,5 @@ header strcasecmp string.h strings.h header strncasecmp string.h strings.h header towlower wchar.h wctype.h header towupper wchar.h wctype.h -header va_arg bits/stdarg.h stdarg.h -header va_copy bits/stdarg.h stdarg.h -header va_end bits/stdarg.h stdarg.h -header va_start bits/stdarg.h stdarg.h header wcrtomb wchar.h stdio.h header wctype wchar.h wctype.h diff --git a/findproblems.sh b/findproblems.sh index f90c1ce..283fcf3 100755 --- a/findproblems.sh +++ b/findproblems.sh @@ -46,6 +46,10 @@ BEGIN { }' >data/musl.all awk -F'\t' ' +herr && lastid != $1 { + print herr + herr = "" +} $2 == "obj" || $2 == "obj posix" { # not declared if ($1 !~ /^_/) @@ -61,18 +65,29 @@ $2 ~ /inc/ && $5 == "p" { head[$1] = $4 } } -$2 ~ /inc posix/ && $4 != $8 { +$2 ~ /inc posix/ && $4 == $8 { + head[$1] = $4 +} +$2 ~ /inc posix/ && head[$1] != $8 && $4 !~ /^bits\// { # different header n = split($8, a, " ") for (i = 1; i <= n; i++) if ($4 == a[i]) break if (i > n) - print "header\t" $1 "\t" $4 "\t" $8 + # delay error msg + herr = "header\t" $1 "\t" $4 "\t" $8 } $2 ~ /inc posix/ && $7 != $10 && $5 == "p" { # different prototype print "proto\t" $1 "\t" $4 "\t" $7 "\t" $10 "\t" $6 "\t" $9 } +{ + lastid = $1 +} +END{ + if(herr) + print herr +} ' data/musl.all >data/musl.problems -- 2.20.1