]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: Warn if rand is used
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 23 Aug 2017 09:59:30 +0000 (12:59 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Thu, 7 Sep 2017 08:40:31 +0000 (11:40 +0300)
src/lib/compat.h

index 9bb59d7b99bfe2beb95c8b16f95d89f037a74a80..4eb140ac45e5f733be0fa0b408ea89b3ba05c7a0 100644 (file)
 #  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;