Blue Swirl wrote: > On Mon, May 21, 2012 at 6:10 PM, Jim Meyering <j...@meyering.net> wrote: >> Blue Swirl wrote: >>> On Mon, May 21, 2012 at 10:03 AM, Jim Meyering <j...@meyering.net> wrote: >>>> From: Jim Meyering <meyer...@redhat.com> >>>> >>>> I noticed this commit, >>>> >>>> virtio-pci: add missing 'static' >>>> >>>> which made this change: >>>> >>>> > -const MemoryRegionPortio virtio_portio[] = { >>>> > +static const MemoryRegionPortio virtio_portio[] = { >>>> >>>> and wondered if there were other variables like that. >>>> The following command shows that there are: >>>> [note that there are probably more: this finds only those >>>> for which the variable name appears in only one source file. ] >>> >>> Also, only for files at the top level. >> >> Thanks. There were so many .o files, I assumed that all were at the top. >> Searching all .o files, I found many more: >> >> $ for i in $(nm -e $(find . -name '*.o')|sed -n 's/.* [BCDGRS] //p'|sort >> -u);\ >> do test $(git grep -lw $i|wc -l) = 1 && echo $i;done > > How about just checking the executables (*-softmmu/qemu-system-xyz and > linux-user/qemu-xyz)?
If I understood what you suggest, that would seem to miss only "test_image": (README-scope-vars is the result of the one above using find and *.o) $ for i in $(nm -e *-softmmu/qemu-system-* linux-user/qemu-*|sed -n 's/.* [BCDGRS] //p'|sort -u); do test $(git grep -lw $i|wc -l) = 1 && echo $i;done > k nm: linux-user/qemu-types.h: File format not recognized [Exit 1] $ diff -u k README-scope-vars --- k 2012-05-21 20:38:15.912149444 +0200 +++ README-scope-vars 2012-05-21 20:12:13.270023293 +0200 @@ -53,6 +62,7 @@ rtas_next s390_virtio_bus_info sh_table special_register_prefix +test_image timers_state v9fs_synth_root virtcon_hds