From e5aed16e7a590c9314cf4b99e792a70c48b3bd16 Mon Sep 17 00:00:00 2001 From: peter Date: Wed, 4 Oct 1995 18:29:01 +0000 Subject: [PATCH] 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 --- lib/libc/stdio/gets.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/libc/stdio/gets.c b/lib/libc/stdio/gets.c index a22fd9dde1ff..d31aeeef9148 100644 --- a/lib/libc/stdio/gets.c +++ b/lib/libc/stdio/gets.c @@ -40,6 +40,9 @@ static char sccsid[] = "@(#)gets.c 8.1 (Berkeley) 6/4/93"; #include #include +#include + +__warn_references(gets, "warning: this program uses gets(), which is unsafe."); char * gets(buf)