Make a link-time warning for the use of gets().

IMHO, the run-time warning should come out, but I'm not game to start that
fight yet...  This uses a feature of the gnu linker.

Inspired by:  NetBSD
This commit is contained in:
peter 1995-10-04 18:29:01 +00:00
parent 1879d2b0f0
commit e5aed16e7a

View File

@ -40,6 +40,9 @@ static char sccsid[] = "@(#)gets.c 8.1 (Berkeley) 6/4/93";
#include <unistd.h>
#include <stdio.h>
#include <sys/cdefs.h>
__warn_references(gets, "warning: this program uses gets(), which is unsafe.");
char *
gets(buf)