Bug 51733 - strlcpy in config.h conflicts with the one in string.h on Solaris
Summary: strlcpy in config.h conflicts with the one in string.h on Solaris
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Solaris
: NOR normal
Target Milestone: ---
Assignee: Stephan Kulow
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-12-10 19:45 UTC by Yuri Khotyaintsev
Modified: 2002-12-22 14:03 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Khotyaintsev 2002-12-10 19:45:58 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
Compiler:          gcc 3.2 
OS:          Solaris

kdelibs/kdecore/configure.in.in contains something incorrect regarding HAVE_STRLCPY.

this lines in config.h conflict with /usr/include/string.h

#ifndef HAVE_STRLCPY
#include <sys/types.h>
#ifdef __cplusplus
extern "C" size_t strlcpy(char*,const char*,size_t) throw();
#else
size_t strlcpy(char*,const char*,size_t);
#endif
#endif

#ifndef HAVE_STRLCAT
#include <sys/types.h>
#ifdef __cplusplus
extern "C" size_t strlcat(char*,const char*,size_t) throw();
#else
size_t strlcat(char*,const char*,size_t);
#endif
#endif
Comment 1 Dirk Mueller 2002-12-11 14:25:28 UTC
Subject: kde-common/admin

CVS commit by mueller: 

corrected strlcpy/strlcat configure check
CCMAIL: 51733-done@bugs.kde.org


  M +29 -23    acinclude.m4.in   2.310


--- kde-common/admin/acinclude.m4.in  #2.309:2.310
@@ -2002,5 +2002,5 @@
 else
   case "$1" in
-        setenv|unsetenv|usleep|getdomainname|random|srandom|seteuid|mkstemps|mkstemp|revoke)
+        setenv|unsetenv|usleep|getdomainname|random|srandom|seteuid|mkstemps|mkstemp|revoke|vsnprintf|strlcpy|strlcat)
                 kde_cv_proto_$1="yes - in libkdefakes"
                 ;;
@@ -2177,4 +2177,29 @@
 ])
 
+AC_DEFUN(AC_CHECK_STRLCPY,
+[
+        KDE_CHECK_FUNC_EXT(strlcpy, [
+#include <string.h>
+],
+[ char buf[20];
+  strlcpy(buf, "KDE function test", sizeof(buf));
+],
+        [unsigned int strlcpy(char*, const char*, unsigned int)],
+        [STRLCPY])
+])
+
+AC_DEFUN(AC_CHECK_STRLCAT,
+[
+        KDE_CHECK_FUNC_EXT(strlcat, [
+#include <string.h>
+],
+[ char buf[20];
+  buf[0]='\0';
+  strlat(buf, "KDE function test", sizeof(buf));
+],
+        [unsigned int strlcat(char*, const char*, unsigned int)],
+        [STRLCAT])
+])
+
 AC_DEFUN(AC_FIND_GIF,
    [AC_MSG_CHECKING([for giflib])
@@ -5240,5 +5265,6 @@
 AC_DEFUN(KDE_CHECK_STRLCPY,
 [
-  AC_CHECK_FUNCS(strlcpy strlcat)
+  AC_CHECK_STRLCPY
+  AC_CHECK_STRLCAT
   AC_CHECK_SIZEOF(size_t)
   AC_CHECK_SIZEOF(unsigned int)
@@ -5246,5 +5272,5 @@
   AC_MSG_CHECKING([sizeof(size_t) == sizeof(unsigned int)])
   AC_TRY_COMPILE(,[
-    #if SIZEOF_SIZE_T != SIZEOF_INT
+    #if SIZEOF_SIZE_T != SIZEOF_UNSIGNED_INT
        choke me
     #endif
@@ -5256,23 +5282,3 @@
       ])
   ])
-
-  AH_VERBATIM(_HAVE_STRLCPY,[
-#ifndef HAVE_STRLCPY
- #ifdef __cplusplus
-extern "C" unsigned int strlcpy(char*,const char*,unsigned int) throw();
-#else
-unsigned int strlcpy(char*,const char*,unsigned int);
-#endif
-#endif
-  ])
-
-  AH_VERBATIM(_HAVE_STRLCAT,[
-#ifndef HAVE_STRLCAT
-#ifdef __cplusplus
-extern "C" unsigned int strlcat(char*,const char*,unsigned int) throw();
-#else
-unsigned int strlcat(char*,const char*,unsigned int);
-#endif
-#endif
-])
 ])


Comment 2 Thefrog 2002-12-22 14:03:57 UTC
I started compiling on solaris 8, gc3.1 this morning and this bug appears 
again in kde31-rc5a -:(