Posted Mar 29, 2012 12:38 UTC (Thu) by nix (subscriber, #2304)
[Link]
Easily, if they suck, are widely considered to suck, and are rarely used. e.g. gets(), in the C standard but even there a compatibility relic of a pre-stdio I/O library, has produced a link warning for the entire lifespan of glibc 2 (RTH added the warning in 1996). To my knowledge nobody sane has ever complained about it, because gets() usage is rare, always considered a bug, and easily replaced with something else in the standard library. None of these things are true of strcpy().
A turning point for GNU libc
Posted Mar 29, 2012 12:57 UTC (Thu) by mina86 (subscriber, #68442)
[Link]
gets() is actually removed in C11. The difference between gets() and strcpy() though is that in the letter you can validate the length before the call, while in the former you have no way of knowing in advance how long the line you are about to read from stdin is.
A turning point for GNU libc
Posted Mar 29, 2012 20:30 UTC (Thu) by nix (subscriber, #2304)
[Link]
Agreed... but gets() was in C89, and C99, and is in C++11, and the deprecation warning was present long before C99 or C++11 existed. So we *do* deprecate stuff in ANSI C, but only if it really does suck (like gets()).