From 913fcb274f353348a353aaabbe872b3b5924a6e7 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Wed, 18 Feb 2015 12:20:32 -0800 Subject: [PATCH] Make gets() deprecated. gets is already deprecated in glibc. Others with __warnattr are not deprecated. Change-Id: I80a276d2b5964630218be47f1c94b146c0d31151 --- libc/include/stdio.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/include/stdio.h b/libc/include/stdio.h index b04aa24c2..eb578f586 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -266,7 +266,7 @@ int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0); #ifndef __AUDIT__ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L -char* gets(char*) __warnattr("gets is very unsafe; consider using fgets"); +char* gets(char*) __attribute__((deprecated("gets is very unsafe; consider using fgets"))); #endif int sprintf(char* __restrict, const char* __restrict, ...) __printflike(2, 3) __warnattr("sprintf is often misused; please use snprintf");