X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=findproblems.sh;h=3bea684ccc21f2048d46d68fabc5fc38734ea6ae;hb=385f72fbe24447529d356b24c79b03f1633206dc;hp=233079a7c42d5afa4178487fff81e911c37a334a;hpb=90a5c3ea7705b5af3312a6190afb1a9f46f67bef;p=musl-tables diff --git a/findproblems.sh b/findproblems.sh index 233079a..3bea684 100755 --- a/findproblems.sh +++ b/findproblems.sh @@ -10,6 +10,7 @@ export LC_ALL=C BEGIN { syms = "data/musl.syms" tags = "data/musl.tags.proto" + srctags = "data/musl.src.tags.proto" posix = "data/posix2008.ok.proto" while (getline < syms == 1) @@ -24,6 +25,15 @@ BEGIN { tag[$1] = $2 "\t" $3 "\t" $5 "\t" $6 } + while (getline < srctags == 1) { + if ($3 != "f") + continue + if ($1 in stag) + stag[$1] = stag[$1] "@" $2 "\t" $3 "\t" $5 "\t" $6 + else + stag[$1] = $2 "\t" $3 "\t" $5 "\t" $6 + } + while (getline < posix == 1) pos[$1] = $2 "\t" $5 "\t" $6 } @@ -33,19 +43,25 @@ BEGIN { s = s " obj" if (tag[$1]) s = s " inc" + else + tag[$1] = "\t\t\t" if (pos[$1]) s = s " posix" + else + pos[$1] = "\t\t" n = split(tag[$1],a,"@") - if (n==0) { - n=1 - a[1]="" - } + for (i = 1; i <= n; i++) + print $1 "\t" substr(s,2) "\t" sym[$1] "\t" a[i] "\t" pos[$1] + n = split(stag[$1],a,"@") for (i = 1; i <= n; i++) print $1 "\t" substr(s,2) "\t" sym[$1] "\t" a[i] "\t" pos[$1] }' >data/musl.all awk -F'\t' ' +BEGIN { +} + herr && lastid != $1 { print herr herr = "" @@ -55,21 +71,32 @@ $2 == "obj" || $2 == "obj posix" { if ($1 !~ /^_/) print "nodecl\t" $1 "\t" $3 } -$2 ~ /inc/ && $5 == "p" { +$5 == "p" { # check for different declarations of the same symbol if ($1 in proto) { if (proto[$1] != $6) print "proto\t" $1 "\t" $4 "\t" head[$1] "\t" $6 "\t" proto[$1] } else { proto[$1] = $6 + protoshort[$1] = $7 head[$1] = $4 } } +$5 == "f" && $1 in protoshort { + # func definition with different proto + dec = protoshort[$1] + def = $7 + gsub(/extern */, "", dec) + gsub(/void/, "", dec) + gsub(/void/, "", def) + if (protoshort[$1] != $7 && dec != def) + print "proto\t" $1 "\t" $4 "\t" head[$1] "\t" $7 "\t" protoshort[$1] +} $2 ~ /inc posix/ && $4 == $8 { head[$1] = $4 herr = "" } -$2 ~ /inc posix/ && head[$1] != $8 && $4 !~ /^bits\// { +$2 ~ /inc posix/ && head[$1] != $8 && $4 !~ /^bits\// && $5 != "f" { # different header n = split($8, a, " ") for (i = 1; i <= n; i++) @@ -90,5 +117,5 @@ END{ if(herr) print herr } -' data/musl.all >data/musl.problems +' data/musl.all |uniq >data/musl.problems