~ubuntu-branches/ubuntu/trusty/diffutils/trusty-proposed

« back to all changes in this revision

Viewing changes to lib/stdio.in.h

  • Committer: Package Import Robot
  • Author(s): Colin Watson
  • Date: 2012-10-30 16:39:50 UTC
  • Revision ID: package-import@ubuntu.com-20121030163950-1fehbjmoat8dzfv8
Tags: 1:3.2-7ubuntu1
Avoid assuming that gets is declared.

Show diffs side-by-side

added added

removed removed

Lines of Context:
681
681
# endif
682
682
#endif
683
683
 
684
 
#if @GNULIB_GETS@
685
 
# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
686
 
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
687
 
#   undef gets
688
 
#   define gets rpl_gets
689
 
#  endif
690
 
_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
691
 
_GL_CXXALIAS_RPL (gets, char *, (char *s));
692
 
# else
693
 
_GL_CXXALIAS_SYS (gets, char *, (char *s));
694
 
#  undef gets
695
 
# endif
696
 
_GL_CXXALIASWARN (gets);
697
684
/* It is very rare that the developer ever has full control of stdin,
698
 
   so any use of gets warrants an unconditional warning.  Assume it is
699
 
   always declared, since it is required by C89.  */
 
685
   so any use of gets warrants an unconditional warning; besides, C11
 
686
   removed it.  */
 
687
#undef gets
 
688
#if HAVE_RAW_DECL_GETS
700
689
_GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
701
690
#endif
702
691
 
1018
1007
# endif
1019
1008
#endif
1020
1009
 
1021
 
/* Some people would argue that sprintf should be handled like gets
1022
 
   (for example, OpenBSD issues a link warning for both functions),
1023
 
   since both can cause security holes due to buffer overruns.
 
1010
/* Some people would argue that all sprintf uses should be warned about
 
1011
   (for example, OpenBSD issues a link warning for it),
 
1012
   since it can cause security holes due to buffer overruns.
1024
1013
   However, we believe that sprintf can be used safely, and is more
1025
1014
   efficient than snprintf in those safe cases; and as proof of our
1026
1015
   belief, we use sprintf in several gnulib modules.  So this header