Finding unnecessary (K&R compat) casts
Kaveh R. Ghazi
ghazi@caip.rutgers.edu
Thu Jul 17 14:47:00 GMT 2003
We have all these now unnecessary casts previously included for K&R
compatibility, e.g. the return type of allocating functions or the
arguments of memcpy, etc. Basically stuff possibly declared as PTR
either now or in the past.
I wanted to generate a complete list of such functions to know where
to look for zapping spurious casts. So far I have these for return
values:
(m|c|re|xm|xc|xre)alloc
xmemdup
alloca
htab_fin(d|d_slot|d_with_hash|d_slot_with_hash)
ggc_[a-z_]*alloc[a-z_]*
for argument casts I have these functions:
mem[a-z]+
Can anyone think of anything else?
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu
More information about the Gcc
mailing list