From: Aki Tuomi Date: Wed, 23 Aug 2017 09:59:30 +0000 (+0300) Subject: lib: Warn if rand is used X-Git-Tag: 2.3.0.rc1~1079 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b082469affbc99c79c1f4b07fda04d8dfc9cbf4a;p=thirdparty%2Fdovecot%2Fcore.git lib: Warn if rand is used --- diff --git a/src/lib/compat.h b/src/lib/compat.h index 9bb59d7b99..4eb140ac45 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -21,6 +21,11 @@ # define NULL ((void *)0) #endif +#if defined(__GNUC__) || defined(__clang__) +int rand(void) __attribute__((deprecated("Do not use rand, use i_rand"))); +int rand_r(unsigned int*) __attribute__((deprecated("Do not use rand_r, use i_rand"))); +#endif + #ifndef __cplusplus #ifdef HAVE__BOOL typedef _Bool bool;