Subject: Re: telldir issue in PR 24324
To: Martin Husemann <>
From: Pavel Cahyna <>
List: tech-userlevel
Date: 05/15/2006 21:13:55
On Sat, May 13, 2006 at 04:32:57PM +0200, Martin Husemann wrote:
> We realy should fix the issue described in PR 24324.
> There is one problem with it though: it changes the const DIR * passed
> to telldir to a DIR *, and it changes sturct _dirdesc (which is what DIR
> is typedefd to). Posix does not require the telldir argument to be const.
> So: would this require a major libc bump, or can we get away with versioning
> every function that gets DIR* passed?

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?