On 3/15/23 13:53, Alejandro Colomar wrote: > Hi Oskari, > > On 3/15/23 13:30, Alejandro Colomar wrote: >> stdc89() >> { >> grep "[[:alpha:]] \**\b$1([[:alnum:]*,. ]*);" /path/to/c89-draft.txt \ >> | sort \ >> | uniq; >> } > > I found a bug. I was missing '_' in identifier names. So it didn't > match memcpy(3), which uses size_t. Also, I found some spurious match, > so added a '$' anchor after the ';'. > > > stdc89() > { > grep "[[:alpha:]] \**\b$1([[:alnum:]*,._ ]*);" /path/to/c89-draft.txt \ > | sort \ > | uniq; > } > > > This function finds 136 declarations in C89. I'm not sure if that's > all of them. Is anyone missing any? Actually, that was missing a few (multi-line declarations, signal(3), which is quite weird, and asm()). The following seems to be complete (per the count of ';'): $ cat stdc89 #!/bin/sh sed -n '/A.3 LIBRARY SUMMARY/,$p' <c89-draft.txt \ | pcregrep -M "(?s)\b$1 *\([[:alnum:]*,._\s\(\)-]*\);$"; $ ./stdc89 '[[:alpha:]][[:alnum:]_]+' \ | grep ';' \ | wc -l 146 $ sed -n '/A.3 LIBRARY SUMMARY/,$p' <c89-draft.txt \ | grep ' .*);' \ | wc -l 146 -- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5
Attachment:
OpenPGP_signature
Description: OpenPGP digital signature