Subject: Re: telldir issue in PR 24324
To: None <pavel.cahyna@st.mff.cuni.cz,>
From: David Laight <david@l8s.co.uk>
List: tech-userlevel
Date: 05/15/2006 22:08:04
On Mon, May 15, 2006 at 09:13:55PM +0200, Pavel Cahyna wrote:
> 
> Would not versioning cause more problems? Suppose you have a library built
> with the hold headers, which got the old versions. Now you build a new
> binary with the new headers and link it with the old library. If DIR * is
> passed between the application and the library, the code would call
> incompatible functions.
> 
> Not versioning would eliminate this problem, but has two other problems:
> 
> - changed sizeof(DIR) will break applications which deep-copy the DIR
>   structure (like DIR dir2, *dirp; ... dir2 = *dirp;)
> 
> - added const could break some gcc optimizations, which were legal with
>   the const but are illegal without it. (If DIR is opaque, is such a
>   situation actually possible)?
> 
> Is there any other issue that I don't see?
> 
> Pavel

Look at the comment I added to the PR - it gives a way of fixing the
problem while maintaining binary compatibility with existing programs.

	David

-- 
David Laight: david@l8s.co.uk