This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Obsolete and Removed POSIX Functions


On Feb 17 09:58, Eric Blake wrote:
> On 02/17/2016 09:53 AM, Corinna Vinschen wrote:
> 
> >> Technically it would be possible to mark these
> >> __attribute__((__deprecated__)) if __POSIX2008_VISIBLE.  I'm not sure if
> >> that *should* be done or not.
> > 
> > I'm really not sure about that.  How's that handled in BSDs or GLibc?
> > I think none of them adds the deprecated attribute to functions still
> > implemented and mentioned in *some* standard.
> > 
> >> There are some cases where __CYGWIN__ and/or __rtems__ are used because that
> >> feature is only implemented on those system(s) and other cases where they
> >> are clearly in place of a proper feature test.  The question is if the
> >> headers really need to reflect the former.
> > 
> > Probably not, unless it's required to guard against contradicting
> > definitions (e.g., in rtems/Cygwin-only headers).
> 
> glibc actively removes gets() unless you specifically request an older
> standard, and meanwhile marks it as deprecated even for the standards
> where it is fully defined:
> 
> > #if !defined __USE_ISOC11 \
> > || (defined __cplusplus && __cplusplus <= 201103L)
> > /* Get a newline-terminated string from stdin, removing the newline.
> > DO NOT USE THIS FUNCTION!! There is no limit on how much it will read.
> > 
> > The function has been officially removed in ISO C11. This opportunity
> > is used to also remove it from the GNU feature list. It is now only
> > available when explicitly using an old ISO C, Unix, or POSIX standard.
> > GCC defines _GNU_SOURCE when building C++ code and the function is still
> > in C++11, so it is also available for C++.
> > 
> > This function is a possible cancellation point and therefore not
> > marked with __THROW. */
> > extern char *gets (char *__s) __wur __attribute_deprecated__;
> > #endif

Ok, so there's an example for a dangerous function which is marked
obsolete.  This may also make sense for mktemp.  But what about
not so dangerous deprecated functions?


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]