From a12bb20412de690c8b3ff39cb08e1545ccea25ff Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Thu, 16 Oct 2008 22:04:46 +0200 Subject: [PATCH] src/collectd.h: Poison various insecure string functions only when debugging is enabled. Because the `poison' pragma complains about macros (which are then never used), this feature does more harm than good in everyday use. So we'll only activate it when building in debug mode, so hopefully authors of new plugins will use this. --- src/collectd.h | 4 ++-- src/perl.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/collectd.h b/src/collectd.h index eece4203..895413a7 100644 --- a/src/collectd.h +++ b/src/collectd.h @@ -247,7 +247,7 @@ # define __attribute__(x) /**/ #endif -#if __GNUC__ +#if defined(COLLECT_DEBUG) && COLLECT_DEBUG && defined(__GNUC__) && __GNUC__ # pragma GCC poison strcpy strcat strtok #endif @@ -258,7 +258,7 @@ * included. */ #ifndef DONT_POISON_SPRINTF_YET -# if __GNUC__ +# if defined(COLLECT_DEBUG) && COLLECT_DEBUG && defined(__GNUC__) && __GNUC__ # pragma GCC poison sprintf # endif #endif diff --git a/src/perl.c b/src/perl.c index 2a8180d2..3df11a3d 100644 --- a/src/perl.c +++ b/src/perl.c @@ -36,7 +36,7 @@ #include #include -#if __GNUC__ +#if defined(COLLECT_DEBUG) && COLLECT_DEBUG && defined(__GNUC__) && __GNUC__ # pragma GCC poison sprintf #endif -- 2.30.2