view doc/posix-functions/gets.texi @ 17260:7ebb2c82d76f octave-stable

stdio: don't assume gets any more Gnulib intentionally does not have a gets module, and now that C11 and glibc have dropped it, we should be more proactive about warning any user on a platform that still has a declaration of this dangerous interface. * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets support. * modules/stdio (Makefile.am): Likewise. * lib/stdio-read.c (gets): Likewise. * tests/test-stdio-c++.cc: Likewise. * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment. * lib/stdio.in.h (gets): Make warning occur in more places. * doc/posix-functions/gets.texi (gets): Update documentation. Reported by Christer Solskogen. Signed-off-by: Eric Blake <eblake@redhat.com>
author Eric Blake <eblake@redhat.com>
date Thu, 29 Mar 2012 13:30:41 -0600
parents 6355dc4626b5
children
line wrap: on
line source

@node gets
@section @code{gets}
@findex gets

POSIX specification:@* @url{http://www.opengroup.org/onlinepubs/9699919799/functions/gets.html}

Gnulib module: ---

Portability problems fixed by Gnulib:
@itemize
@end itemize

Portability problems not fixed by Gnulib:
@itemize
@item
This function should never be used, because it can overflow any given buffer.
@item
When reading from a non-blocking pipe whose buffer is empty, this function
fails with @code{errno} being set to @code{EINVAL} instead of @code{EAGAIN} on
some platforms:
mingw, MSVC 9.
@item
On Windows platforms (excluding Cygwin), this function does not set @code{errno}
upon failure.
@end itemize