Re: [PATCH 1/3] sparse: Fix some "symbol not declared" warnings
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 11, 2011, 21:38 UTC
- Message-ID
- <7vobyqn4jh.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <4E6D0E3F.3090304@ramsay1.demon.co.uk>
There are many others that can be identified by running the attached script after you build your git. I'll follow this message up with three consolidated patches, but the latter two needs to be split into smaller pieces to be either queued on top (for topics in next) or squashed into (for topics in pu), which I am not going to do myself today (hint, hint).
#!/usr/bin/perl -w
my %defd = ();
my %used = ();
my %def_ok = map { $_ => 1 } qw(
main
alloc_report
have_git_dir
prepare_git_cmd
print_string_list
tm_to_time_t
unsorted_string_list_has_string
xdl_atol
xdl_cha_first
xdl_cha_next
xdl_mmfile_size
xdl_num_out
xdl_recs_cmp
);for (<*.o>, <*/*.o>, <*/*/*.o>) {
my $obj = $_;
open(I, "-|", qw(nm -g), $obj) or die;
while (<I>) {
unless (/^[0-9a-f ]+([A-Z]) (\S*)$/) {
print STDERR "? $_";
next;
}
if (($1 eq "U") || $1 eq "C") {
$used{$2}++;
}
else {
push @{$defd{$obj}}, $2;
}
}
close I;
}for my $obj (sort keys %defd) {
my $syms = $defd{$obj};
for my $sym (@$syms) {
next if exists $used{$sym} or exists $def_ok{$sym};
print "$obj - $sym\n";
}
}