public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* Warning fixes
@ 2005-12-30  9:11 Andreas Jaeger
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Jaeger @ 2005-12-30  9:11 UTC (permalink / raw)
  To: Glibc hackers

[-- Attachment #1: Type: text/plain, Size: 3720 bytes --]


The appended patch removes a couple of warnings I got during
compilation:

gethnamaddr.c:180: warning: function declaration isn’t a prototype
gethnamaddr.c:525: warning: function declaration isn’t a prototype
gethnamaddr.c:669: warning: function declaration isn’t a prototype
gethnamaddr.c:882: warning: function declaration isn’t a prototype
res_debug.c:630: warning: function declaration isn’t a prototype
res_debug.c:648: warning: function declaration isn’t a prototype
res_debug.c:690: warning: function declaration isn’t a prototype

Ok to commit?

Andreas

2005-12-29  Andreas Jaeger  <aj@suse.de>

	* resolv/res_debug.c (latlon2ul): Use ISO C function declaration.
	(precsize_aton): Likewise.
	(precsize_ntoa): Likewise.

	* resolv/gethnamaddr.c (_gethtbyname): Remove extra prototype.
	(gethostbyname2): Likewise.
	(gethostbyaddr): Likewise.
	(getanswer): Use ISO C function declaration.

Index: resolv/gethnamaddr.c
===================================================================
RCS file: /cvs/glibc/libc/resolv/gethnamaddr.c,v
retrieving revision 1.51
diff -u -p -r1.51 gethnamaddr.c
--- resolv/gethnamaddr.c	21 Nov 2005 15:43:03 -0000	1.51
+++ resolv/gethnamaddr.c	30 Dec 2005 09:10:12 -0000
@@ -176,11 +176,7 @@ Dprintf(msg, num)
 
 
 static struct hostent *
-getanswer(answer, anslen, qname, qtype)
-	const querybuf *answer;
-	int anslen;
-	const char *qname;
-	int qtype;
+getanswer (const querybuf *answer, int anslen, const char *qname, int qtype)
 {
 	register const HEADER *hp;
 	register const u_char *cp;
@@ -522,7 +518,6 @@ gethostbyname2(name, af)
 	char *bp;
 	int n, size, type, len;
 	struct hostent *ret;
-	extern struct hostent *_gethtbyname2();
 
 	if (__res_maybe_init (&_res, 0) == -1) {
 		__set_h_errno (NETDB_INTERNAL);
@@ -666,7 +661,6 @@ gethostbyaddr(addr, len, af)
 	u_long old_options;
 	char hname2[MAXDNAME+1];
 #endif /*SUNSECURITY*/
-	extern struct hostent *_gethtbyaddr();
 
 	if (__res_maybe_init (&_res, 0) == -1) {
 		__set_h_errno (NETDB_INTERNAL);
@@ -879,7 +873,6 @@ struct hostent *
 _gethtbyname(name)
 	const char *name;
 {
-	extern struct hostent *_gethtbyname2();
 	struct hostent *hp;
 
 	if (_res.options & RES_USE_INET6) {
Index: resolv/res_debug.c
===================================================================
RCS file: /cvs/glibc/libc/resolv/res_debug.c,v
retrieving revision 1.31
diff -u -p -r1.31 res_debug.c
--- resolv/res_debug.c	27 Oct 2004 21:26:57 -0000	1.31
+++ resolv/res_debug.c	30 Dec 2005 09:10:12 -0000
@@ -626,8 +626,7 @@ static const unsigned int poweroften[10]
 
 /* takes an XeY precision/size value, returns a string representation. */
 static const char *
-precsize_ntoa(prec)
-	u_int8_t prec;
+precsize_ntoa (u_int8_t prec)
 {
 	static char retbuf[sizeof "90000000.00"];	/* XXX nonreentrant */
 	unsigned long val;
@@ -644,8 +643,7 @@ precsize_ntoa(prec)
 
 /* converts ascii size/precision X * 10**Y(cm) to 0xXY.  moves pointer. */
 static u_int8_t
-precsize_aton(strptr)
-	const char **strptr;
+precsize_aton (const char **strptr)
 {
 	unsigned int mval = 0, cmval = 0;
 	u_int8_t retval = 0;
@@ -686,9 +684,7 @@ precsize_aton(strptr)
 
 /* converts ascii lat/lon to unsigned encoded 32-bit number.  moves pointer. */
 static u_int32_t
-latlon2ul(latlonstrptr,which)
-	const char **latlonstrptr;
-	int *which;
+latlon2ul (const char **latlonstrptr, int *which)
 {
 	const char *cp;
 	u_int32_t retval;

-- 
 Andreas Jaeger, aj@suse.de, http://www.suse.de/~aj
  SUSE Linux Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
   GPG fingerprint = 93A3 365E CE47 B889 DF7F  FED1 389A 563C C272 A126

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* warning fixes
@ 2000-10-18  4:01 Andreas Jaeger
  0 siblings, 0 replies; 2+ messages in thread
From: Andreas Jaeger @ 2000-10-18  4:01 UTC (permalink / raw)
  To: GNU libc hacker

I've commited the appended patches to silence these valid GCC
warnings:

regex.c:2728: warning: operation on `idx' may be undefined
../sysdeps/generic/dl-cache.c:187: warning: assignment from incompatible pointer type

Andreas

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

	* posix/regex.c (regex_compile): Change to get defined behaviour.

	* sysdeps/generic/dl-cache.c (_dl_load_cache_lookup): Change to
	avoid warning.

============================================================
Index: posix/regex.c
--- posix/regex.c	2000/09/14 08:21:48	1.82
+++ posix/regex.c	2000/10/18 10:43:03
@@ -2725,7 +2725,10 @@
 			    if (c1 == 1)
 			      range_start = extra[idx];
 			    while (c1-- > 0)
-			      SET_LIST_BIT (extra[idx++]);
+			      {
+				SET_LIST_BIT (extra[idx]);
+				++idx;
+			      }
 			  }
 #endif
 			had_char_class = false;
============================================================
Index: sysdeps/generic/dl-cache.c
--- sysdeps/generic/dl-cache.c	2000/10/11 07:45:30	1.23
+++ sysdeps/generic/dl-cache.c	2000/10/18 10:43:03
@@ -184,7 +184,8 @@
 	}
       else if (file && cachesize > sizeof *cache_new)
 	{
-	  cache = cache_new = (struct cache_file_new *) file;
+	  cache_new = file;
+	  cache = file;
 	  if (memcmp (cache_new->magic, CACHEMAGIC_NEW,
 		      sizeof CACHEMAGIC_NEW - 1)
 	      || memcmp (cache_new->version, CACHE_VERSION,

-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-12-30  9:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-30  9:11 Warning fixes Andreas Jaeger
  -- strict thread matches above, loose matches on Subject: below --
2000-10-18  4:01 warning fixes Andreas Jaeger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).