Source-Changes-D archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: CVS commit: src/lib/libc/stdio



On Tue, May 04, 2010 at 06:35:48PM +0700, Robert Elz wrote:
> I don't understand the change - that is, I don't understand the
> sentence that was added to the man page, it says ...
> 
> "The revision marked gets() as obsolete..."
> 
> What revision???

In my manual page:

     The functions fgets() and gets() conform to ANSI X3.159-1989
     (``ANSI C89'') and IEEE Std 1003.1-2001 (``POSIX.1'').  The IEEE Std
     1003.1-2008 (``POSIX.1'') revision marked gets() as obsolescent, recom-
     mending the use of fgets() instead.

What was the problem again?

> While I'm here, I would also note that it really makes no sense go racing
> about documenting things as not complying to some standard or other
> (by which I mean, that some function is not (or no longer) a standard
> function, as distinct from "our implementation is different from the
> standard", which is definitely worthy of documentation.)

Generally, I disagree. 

It may be very important to someone to know which functions conform to the
"stupid standard", possibly to limit something to some dialect only. And in
this case it means that gets() probably won't conform to it in the future.
You could think about this as a warning.

> We have LOTS of functions that aren't standardised anywhere, racing
> around saying they're not, helps no-one.

Sure. What is the point? If there is no STANDARDS, there is no standards.
Besides, this is false: I haven't done anything like that.

> By all means document functions which do (or are intended to) conform to
> some standard, and perhaps later remove that mention if the version of
> the standard in question is obsolete, and newer versions don't include
> the function in question (or where it is deprecated in them) - but there's
> no need to include specific text saying that a function is not standard.
> Simply not saying that it does conform to some standard should be enough.

As something like gets() has been standardized for ages, it makes sense to
explicitly note that this may no longer be true (with respect to POSIX).

This way a reader (and whoever maintains the page) can also have some sense
of history, which is always important in itself.

Unlike e.g. ISO, POSIX dares to deprecate stuff, which is a good thing, IMO.
In the future, if for instance a function f() is removed from glibc due
this, we might want to follow and move f() to some compatibility layer.

- Jukka. 


Home | Main Index | Thread Index | Old Index