[collectd] [PATCH] perl plugin: Work around a compiler warning on FreeBSD.

Sebastian Harl sh at tokkee.org
Mon Apr 28 16:53:57 CEST 2008


On FreeBSD, PERL_SYS_INIT3 expands to some expression which triggers a "value
computed is not used" warning by gcc. By telling the compiler to ignore this
value, we can work around this issue. In the long run, this should imho be
fixed in Perl though.

Signed-off-by: Sebastian Harl <sh at tokkee.org>
---
 src/perl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/perl.c b/src/perl.c
index 6d3326f..ecd7660 100644
--- a/src/perl.c
+++ b/src/perl.c
@@ -1364,6 +1364,11 @@ static int init_pi (int argc, char **argv)
 		exit (1);
 	}
 
+#ifdef __FreeBSD__
+	/* On FreeBSD, PERL_SYS_INIT3 expands to some expression which
+	 * triggers a "value computed is not used" warning by gcc. */
+	(void)
+#endif
 	PERL_SYS_INIT3 (&argc, &argv, &environ);
 
 	perl_threads = (c_ithread_list_t *)smalloc (sizeof (c_ithread_list_t));
-- 
1.5.5.1.79.g57cf

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20080428/a3769d77/attachment.pgp 


More information about the collectd mailing list