From: Florian Forster Date: Thu, 16 Oct 2008 20:04:46 +0000 (+0200) Subject: src/collectd.h: Poison various insecure string functions only when debugging is enabled. X-Git-Tag: collectd-4.4.4~1 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=a12bb20412de690c8b3ff39cb08e1545ccea25ff 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. --- 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