[PATCH] Remove unused functions with callcatcher

Andrew Bartlett abartlet at samba.org
Wed Feb 8 22:40:09 MST 2012


I've prepared a branch with the unused functions that I've found using
the callcatcher tool.

As Samba has developed, a good number of utility functions have been
developed, and in some cases have become orphans - no longer being
called from anywhere in the code base.

Cleaning these out reduces (slightly) our binary size, but also allows
us to find other functions that might also be uncalled from anywhere
inside Samba, and avoids us spending effort porting them when codebase
wide changes are made. 

In other cases, it shows the value of higher level work, such as the
GSSAPI code for session setup, as delicate utility functions that
supported that system become obsolete. 

http://git.samba.org/?p=abartlet/samba.git/.git;a=shortlog;h=refs/heads/remove-unused-functions

This is the list of functions I've determined are unused (both by
compilation and by git grep).  Please let me know soon if you wish to
adopt any of these orphan functions and would prefer I skip removing
them:

connect_to_ipc_krb5()
ads_pull_sids_from_extendeddn()
ads_upn_suffixes()
ads_set_machine_password()
ipstr_list_free()
secrets_delete_machine_password()
secrets_delete_generic()
smbldap_talloc_smallest_attribute()
sys_sendto()
sys_recv()
sys_inet_makeaddr()
sys_gethostbyname()
standard_sub_conn()
sys_fcntl_long()
sys_fseek()
winsdb_get_seqnumber()
dup_registry_value() and free_registry_value()
dup_sec_desc_buf()
del_sid_from_array
dbwrap_change_int32_atomic
create_complex_dir()
getpwnam_alloc()
kerberos_set_creds_enctype()
kerberos_compatible_enctypes
is_myworkgroup()
isupper_m()
rpcstr_push()
smb_krb5_mk_error()
share_defined()
smbpasswd_decode_acb_info()
str_format_nbt_domain()
strcmp_w()
tls_support()
unmap_file()
popt_common_dont_ask()
pid_path()
prs_uint8()
pull_string_fn
iconv_talloc()

This is not the full list, and I attach the patch I made to callcatcher
to make it work with waf.  Run it as CC="callcatcher gcc" ./configure.

Andrew Bartlett

-- 
Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: callcatcher.patch
Type: text/x-patch
Size: 627 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20120209/b7c7c66a/attachment.bin>


More information about the samba-technical mailing list