6 awk -F'\t' '$3 ~ /^[sut]$/ {
8 }' data
/musl.tags
>/tmp
/m.
type
9 echo 'short' >>/tmp
/m.
type
10 echo 'int' >>/tmp
/m.
type
11 echo 'long' >>/tmp
/m.
type
12 echo 'long long' >>/tmp
/m.
type
13 echo 'float' >>/tmp
/m.
type
14 echo 'double' >>/tmp
/m.
type
15 echo 'long double' >>/tmp
/m.
type
16 echo 'wchar_t' >>/tmp
/m.
type
17 echo '_Bool' >>/tmp
/m.
type
18 echo 'void*' >>/tmp
/m.
type
22 find .
-name '*.h' |
sed 's,^\./,,' >/tmp
/m.header
25 echo '#define _GNU_SOURCE 1' >sizeof.c
26 echo '#define _LARGEFILE64_SOURCE 1' >>sizeof.c
27 echo '#define _FILE_OFFSET_BITS 64' >>sizeof.c
28 echo '#define SYSLOG_NAMES 1' >>sizeof.c
29 echo '#include <stddef.h>' >>sizeof.c
30 echo '#include <sys/types.h>' >>sizeof.c
33 sort /tmp
/m.header |
uniq |
awk '
34 /^(sys\/cachectl|stdalign|stdnoreturn)\.h$/ { printf "//" }
35 { print "#include <" $0 ">" }' >>sizeof.c
36 echo '#define p(x) printf("%s\\t%u\\n", #x, sizeof(x));' >>sizeof.c
37 echo 'int main(){' >>sizeof.c
38 sort /tmp
/m.
type |
uniq |
awk '
39 /^(struct|union) __(CODE|ptcb|siginfo|ucontext|sigjmp_buf|double_repr|float_repr)$/ ||
40 /^(DIR|FILE|elf_fpxregset_t|struct user_fpxregs_struct|Sg_io_vec)$/ { printf "//" }
41 { print "p(" $0 ")" }' >>sizeof.c
42 echo 'return 0;}' >>sizeof.c