Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Mar 1997 23:57:15 +0100 (CET)
From:      Philippe Charnier <charnier@xp11.frmug.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   bin/2998: compilation warnings in patch
Message-ID:  <199703152257.XAA05805@xp11.frmug.org>
Resent-Message-ID: <199703152320.PAA15484@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         2998
>Category:       bin
>Synopsis:       compilation warnings in patch
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Mar 15 15:20:00 PST 1997
>Last-Modified:
>Originator:     Philippe Charnier
>Organization:
>Release:        FreeBSD 3.0-CURRENT i386
>Environment:

	

>Description:

===> gnu/usr.bin/patch
/usr/src/gnu/usr.bin/patch/getopt.c: In function `_getopt_internal':
/usr/src/gnu/usr.bin/patch/getopt.c:455: warning: implicit declaration of functi
on `strncmp'
/usr/src/gnu/usr.bin/patch/inp.c: In function `plan_a':
/usr/src/gnu/usr.bin/patch/inp.c:145: warning: too many arguments for format
/usr/src/gnu/usr.bin/patch/patch.c:433: warning: control reaches end of non-void
 function
/usr/src/gnu/usr.bin/patch/util.c: In function `savestr':
/usr/src/gnu/usr.bin/patch/util.c:172: warning: suggest parentheses around assig
nment used as truth value
/usr/src/gnu/usr.bin/patch/util.c: In function `fetchname':
/usr/src/gnu/usr.bin/patch/util.c:420: warning: too many arguments for format

>How-To-Repeat:

	

>Fix:
	

Index: gnu/usr.bin/patch/getopt.c
===================================================================
RCS file: /home2h/FreeBSD.cvsroot/src/gnu/usr.bin/patch/getopt.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 getopt.c
--- getopt.c	1993/06/19 14:21:51	1.1.1.1
+++ getopt.c	1997/03/15 11:38:18
@@ -75,6 +75,8 @@
 #define	__alloca	alloca
 #endif	/* GNU C library.  */
 
+#include <string.h>
+
 /* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a
    long-named option.  Because this is not POSIX.2 compliant, it is
    being phased out.  */
Index: gnu/usr.bin/patch/inp.c
===================================================================
RCS file: /home2h/FreeBSD.cvsroot/src/gnu/usr.bin/patch/inp.c,v
retrieving revision 1.4
diff -u -r1.4 inp.c
--- inp.c	1997/02/13 21:10:39	1.4
+++ inp.c	1997/03/15 11:30:21
@@ -142,7 +142,7 @@
 
 #define try(f,a1,a2) (Sprintf(s + pathlen, f, a1, a2), stat(s, &cstat) == 0)
 	if ((   try("RCS/%s%s", filebase, RCSSUFFIX)
-	     || try("RCS/%s"  , filebase,         0)
+	     || try("RCS/%s%s", filebase,        "")
 	     || try(    "%s%s", filebase, RCSSUFFIX))
 	    &&
 	    /* Check that RCS file is not working file.
Index: gnu/usr.bin/patch/patch.c
===================================================================
RCS file: /home2h/FreeBSD.cvsroot/src/gnu/usr.bin/patch/patch.c,v
retrieving revision 1.7
diff -u -r1.7 patch.c
--- patch.c	1997/02/13 21:10:41	1.7
+++ patch.c	1997/03/15 11:36:22
@@ -430,6 +430,7 @@
 	set_signals(1);
     }
     my_exit(failtotal);
+    return (0); /* not reached */
 }
 
 /* Prepare to find the next patch to do in the patch file. */
Index: gnu/usr.bin/patch/util.c
===================================================================
RCS file: /home2h/FreeBSD.cvsroot/src/gnu/usr.bin/patch/util.c,v
retrieving revision 1.3
diff -u -r1.3 util.c
--- util.c	1997/02/13 21:10:44	1.3
+++ util.c	1997/03/15 11:37:15
@@ -169,7 +169,7 @@
     }
     else {
 	t = rv;
-	while (*t++ = *s++);
+	while ((*t++ = *s++));
     }
     return rv;
 }
@@ -417,7 +417,7 @@
 
 #define try(f, a1, a2) (Sprintf(tmpbuf + pathlen, f, a1, a2), stat(tmpbuf, &filestat) == 0)
 	if (   try("RCS/%s%s", filebase, RCSSUFFIX)
-	    || try("RCS/%s"  , filebase,         0)
+	    || try("RCS/%s%s", filebase,        "")
 	    || try(    "%s%s", filebase, RCSSUFFIX)
 	    || try("SCCS/%s%s", SCCSPREFIX, filebase)
 	    || try(     "%s%s", SCCSPREFIX, filebase))
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199703152257.XAA05805>