diff options
author | peter <peter@FreeBSD.org> | 1995-10-04 18:29:01 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1995-10-04 18:29:01 +0000 |
commit | e5aed16e7a590c9314cf4b99e792a70c48b3bd16 (patch) | |
tree | 783159a174b10af9016c72c254a2a56abd74d4ba | |
parent | 1879d2b0f098d5d4af6cf944dd49e0ebd1b03e1f (diff) | |
download | FreeBSD-src-e5aed16e7a590c9314cf4b99e792a70c48b3bd16.zip FreeBSD-src-e5aed16e7a590c9314cf4b99e792a70c48b3bd16.tar.gz |
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
-rw-r--r-- | lib/libc/stdio/gets.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/stdio/gets.c b/lib/libc/stdio/gets.c index a22fd9d..d31aeee 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 <unistd.h> #include <stdio.h> +#include <sys/cdefs.h> + +__warn_references(gets, "warning: this program uses gets(), which is unsafe."); char * gets(buf) |