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:
parent
1879d2b0f0
commit
e5aed16e7a
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user