]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Avoid MinGW-w64 strndup compiler warning
authorWolfgang Stöggl <c72578@yahoo.de>
Sat, 13 Apr 2019 20:34:48 +0000 (22:34 +0200)
committerTobias Oetiker <tobi@oetiker.ch>
Thu, 25 Apr 2019 14:57:34 +0000 (16:57 +0200)
- Fixes the following MinGW-w64 GCC compiler warning:
  rrd_create.c:287:14: warning: declaration of 'strndup' shadows a
  built-in function [-Wshadow] static char *strndup(
- MinGW-w64: strndup is not detected by configure, therefore
  HAVE_STRNDUP is not defined.
  Use strndup_() here instead of strndup() to avoid any collisions.

src/rrd_create.c

index c2565904f061f0c934cf5d13a733a38f46b90248..ff501a62df5e719d4829d3ecd4d851f743e63486 100644 (file)
@@ -264,6 +264,8 @@ int rrd_create(
 }
 
 #ifndef HAVE_STRNDUP
+/* Avoid MinGW-w64 warning: declaration of 'strndup' shadows a built-in function [-Wshadow] */
+#define strndup strndup_
 /* Implement the strndup function.
    Copyright (C) 2005 Free Software Foundation, Inc.
    Written by Kaveh R. Ghazi <ghazi@caip.rutgers.edu>.