From 9b4f77f5cfc45a377b7de7195341a7769a722b74 Mon Sep 17 00:00:00 2001 From: Yabin Cui Date: Mon, 23 Feb 2015 16:42:07 -0800 Subject: [PATCH] Make tempnam/mktemp deprecated. Bug: 19340053 Change-Id: Ib02c65814ef97cd1758fd8142b73736cc8bc1700 --- libc/include/stdio.h | 6 +++--- libc/include/stdlib.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libc/include/stdio.h b/libc/include/stdio.h index eb578f586..12408382f 100644 --- a/libc/include/stdio.h +++ b/libc/include/stdio.h @@ -266,16 +266,16 @@ int vdprintf(int, const char * __restrict, __va_list) __printflike(2, 0); #ifndef __AUDIT__ #if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L -char* gets(char*) __attribute__((deprecated("gets is very unsafe; consider using fgets"))); +char* gets(char*) __attribute__((deprecated("gets is unsafe, use fgets instead"))); #endif int sprintf(char* __restrict, const char* __restrict, ...) __printflike(2, 3) __warnattr("sprintf is often misused; please use snprintf"); -char* tmpnam(char*) __warnattr("tmpnam possibly used unsafely; consider using mkstemp"); int vsprintf(char* __restrict, const char* __restrict, __va_list) __printflike(2, 0) __warnattr("vsprintf is often misused; please use vsnprintf"); +char* tmpnam(char*) __attribute__((deprecated("tmpnam is unsafe, use mkstemp or tmpfile instead"))); #if __XPG_VISIBLE char* tempnam(const char*, const char*) - __warnattr("tempnam possibly used unsafely; consider using mkstemp"); + __attribute__((deprecated("tempnam is unsafe, use mkstemp or tmpfile instead"))); #endif #endif diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h index cbd7aeb98..84bf56dee 100644 --- a/libc/include/stdlib.h +++ b/libc/include/stdlib.h @@ -58,7 +58,7 @@ extern int unsetenv(const char*); extern int clearenv(void); extern char* mkdtemp(char*); -extern char* mktemp(char*) __warnattr("mktemp possibly used unsafely; consider using mkstemp"); +extern char* mktemp(char*) __attribute__((deprecated("mktemp is unsafe, use mkstemp or tmpfile instead"))); extern int mkostemp64(char*, int); extern int mkostemp(char*, int);