This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Missing includes


Compiling current glibc on x86, I saw these warnings:

nss_db/db-initgroups.c: In function '_nss_db_initgroups_dyn':
nss_db/db-initgroups.c:60:3: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
nss_db/db-initgroups.c:60:20: warning: incompatible implicit declaration of built-in function 'strlen' [enabled by default]
nss_db/db-initgroups.c:74:7: warning: implicit declaration of function 'strncmp' [-Wimplicit-function-declaration]

nss_db/db-init.c: In function '_nss_db_init':
nss_db/db-init.c:46:3: warning: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
nss_db/db-init.c:46:3: warning: incompatible implicit declaration of built-in function 'strcpy' [enabled by default]

I'm appending a patch.

But I'm lost right now with the following:
In file included from ../nptl/sysdeps/i386/tls.h:29:0,
                 from ../sysdeps/i386/i486/bits/atomic.h:21,
                 from ../include/atomic.h:51,
                 from ../nscd/nscd-client.h:30,
                 from ../nscd/nscd.h:31,
                 from nss_db/db-init.c:21:
../nptl/sysdeps/pthread/list.h: In function 'list_add':
../nptl/sysdeps/pthread/list.h:64:3: warning: implicit declaration of function 'atomic_write_barrier ' [-Wimplicit-function-declaration]

Where should the declaration come from?


Andreas

2011-10-18  Andreas Jaeger  <aj@suse.de>

	* nss/nss_db/db-initgroups.c: Add <string.h> for string functions.
	* nss/nss_db/db-init.c: Likewise.

diff --git a/nss/nss_db/db-init.c b/nss/nss_db/db-init.c
index 8228d61..85ac48f 100644
--- a/nss/nss_db/db-init.c
+++ b/nss/nss_db/db-init.c
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <paths.h>
+#include <string.h>
 #include <nscd/nscd.h>
 
 
diff --git a/nss/nss_db/db-initgroups.c b/nss/nss_db/db-initgroups.c
index aa8163b..1b806e5 100644
--- a/nss/nss_db/db-initgroups.c
+++ b/nss/nss_db/db-initgroups.c
@@ -22,6 +22,7 @@
 #include <errno.h>
 #include <grp.h>
 #include <paths.h>
+#include <string.h>
 
 #include "nss_db.h"
 

-- 
 Andreas Jaeger aj@{suse.com,opensuse.org} Twitter/Identica: jaegerandi
  SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
    GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126
diff --git a/nss/nss_db/db-init.c b/nss/nss_db/db-init.c
index 8228d61..85ac48f 100644
--- a/nss/nss_db/db-init.c
+++ b/nss/nss_db/db-init.c
@@ -18,6 +18,7 @@
    02111-1307 USA.  */
 
 #include <paths.h>
+#include <string.h>
 #include <nscd/nscd.h>
 
 
diff --git a/nss/nss_db/db-initgroups.c b/nss/nss_db/db-initgroups.c
index aa8163b..1b806e5 100644
--- a/nss/nss_db/db-initgroups.c
+++ b/nss/nss_db/db-initgroups.c
@@ -22,6 +22,7 @@
 #include <errno.h>
 #include <grp.h>
 #include <paths.h>
+#include <string.h>
 
 #include "nss_db.h"
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]