libiberty: hashtab allocation functions with an extra argument

Daniel Jacobowitz drow@mvista.com
Wed Jan 15 19:19:00 GMT 2003


On Wed, Jan 15, 2003 at 01:28:11PM -0500, DJ Delorie wrote:
> 
> > What kind of problems would changing the size of the hashtab struct
> > cause?
> 
> This is the least problematic change, and generally only affects
> poorly written programs.  If a module uses sizeof(struct htab) to do
> something, changing the size of the htab may cause problems unless
> you're really careful to recompile everything.  When shared
> libiberties are involved, it's not always possible to recompile
> everything.
>
> And before you say "well, then screw them" I add that it's our
> responsibility to think of all the possible problems and how we will
> deal with them before blindly changing a public interface.  If you can
> successfully convince us that your change can not cause problems with
> other packages, then that reason for opposing your change becomes
> moot.

Which you're not supposed to do, anyway, since the only allocation
function for these beasts returns an allocated pointer.  This doesn't
bother me much; I can not think of a correct use of the hash table
structure that would suffer from this problem.

That doesn't mean there isn't one, of course, but I can't think of one. 
It doesn't even affect the GCC garbage collector's walking functions,
since the extra fields would be unused.

> The next most problematic change would involve changing or removing an
> existing field, followed by adding a required access function where
> direct access was allowed before.

I do neither of these.

On Wed, Jan 15, 2003 at 02:05:34PM -0500, DJ Delorie wrote:
> And yes, I KNOW the difference between source and binary
> compatibility.  And compatibility is NOT a constraint, merely a
> consideration.  I will NOT let a header change go through blindly, but
> neither will I be unreceptive to persuasion.  So please stop playing
> word games.  If you want the patch to go through, address my concerns.

DJ, could you then tell me what your concerns are?  Your original response
was:
> 1. Changing the htab structure breaks backward compatibility.

which is not helpful in telling me what needs to be considered.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gcc-patches mailing list