]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
../../libparse/parse.c:211: warning: implicit declaration of function 'bcopy'
authorDave Hart <hart@ntp.org>
Sun, 3 May 2009 05:08:34 +0000 (05:08 +0000)
committerDave Hart <hart@ntp.org>
Sun, 3 May 2009 05:08:34 +0000 (05:08 +0000)
../../libparse/parse.c:211: warning: incompatible implicit declaration of built-
in function 'bcopy'

#include <stdlib.h> in ntp_lineedit.c which uses free()

bk: 49fd26d2_1wAkHMQ4yPK7ckHpA-twQ

configure.ac
include/ntp_string.h
libntp/ntp_lineedit.c

index 14e3f78329ec0dc02ec244e523e44e5ea3526b4c..d01ac6e09de0cdda838400059f822881c1ca5ff8 100644 (file)
@@ -3292,6 +3292,7 @@ case "$ntp_parseutil$ac_cv_header_sys_stropts_h" in
      sparc-*-solaris2*)
        ans=parsesolaris
        MAKE_PARSEKMODULE=parse
+       AC_CHECK_HEADERS([strings.h])
        ;;
     esac
     ;;
index 17163b053305c9941c04fb51ff6579043cba736a..aab7084b0536e5f6b8403def021a79376527ad9b 100644 (file)
@@ -36,13 +36,20 @@ char *strchr(), *strrchr();
 #endif /* STDC_HEADERS */
 
 #ifdef NTP_NEED_BOPS
-# define memcmp(a,b,c) bcmp(a,b,(int)c)
-# define memmove(t,f,c) bcopy(f,t,(int)c)
-# define memcpy(t,f,c) bcopy(f,t,(int)c)
-# define memset(a,x,c) if (x == 0x00) bzero(a,(int)c); else ntp_memset((char*)a,x,c)
 
-void ntp_memset (char *, int, int);
+#ifdef HAVE_STRINGS_H
+# include <strings.h>          /* bcmp, bcopy, bzero */
+#endif
+
+void   ntp_memset      (char *, int, int);
 
+#define memcmp(a, b, c)                bcmp(a, b, (int)(c))
+#define memmove(t, f, c)       bcopy(f, t, (int)(c))
+#define memcpy(t, f, c)                bcopy(f, t, (int)(c))
+#define memset(a, x, c)                if (0 == (x)) \
+                                       bzero(a, (int)(c)); \
+                               else \
+                                       ntp_memset((char *)(a), x, c)
 #endif /*  NTP_NEED_BOPS */
 
 #endif /* _ntp_string_h */
index aa402308fed65c9a9d2c1faf832aef9dc541d940..70b54f97ca6a26248e8aa7d106ee86b1309f1d05 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <errno.h>
 #include <string.h>
+#include <stdlib.h>
 #include <stdio.h>
 
 #if defined(HAVE_READLINE_HISTORY)