diff options
author | Oran Agra <oran@redislabs.com> | 2023-05-15 13:08:15 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-15 13:08:15 +0300 |
commit | a51eb05b1895babb17c37c36b963e2bcbd5496d5 (patch) | |
tree | 7be24b09e0a5621a03e9f9ffe9ef27fcb44d8345 /src/fmacros.h | |
parent | e26a769d9627ebecb8607375580970a740348956 (diff) | |
parent | 986dbf716e0cb904c80bb444635cea3242859cc1 (diff) | |
download | redis-7.2.tar.gz |
Diffstat (limited to 'src/fmacros.h')
-rw-r--r-- | src/fmacros.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fmacros.h b/src/fmacros.h index a97d21a47..c5da4b734 100644 --- a/src/fmacros.h +++ b/src/fmacros.h @@ -58,6 +58,16 @@ #define _LARGEFILE_SOURCE #define _FILE_OFFSET_BITS 64 +/* deprecate unsafe functions + * + * NOTE: We do not use the poison pragma since it + * will error on stdlib definitions in files as well*/ +#if (__GNUC__ && __GNUC__ >= 4) && !defined __APPLE__ +int sprintf(char *str, const char *format, ...) __attribute__((deprecated("please avoid use of unsafe C functions. prefer use of snprintf instead"))); +char *strcpy(char *restrict dest, const char *src) __attribute__((deprecated("please avoid use of unsafe C functions. prefer use of redis_strlcpy instead"))); +char *strcat(char *restrict dest, const char *restrict src) __attribute__((deprecated("please avoid use of unsafe C functions. prefer use of redis_strlcat instead"))); +#endif + #ifdef __linux__ /* features.h uses the defines above to set feature specific defines. */ #include <features.h> |