Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/bin/sh compile with WARNS = 2



details:   https://anonhg.NetBSD.org/src/rev/69dc93af2625
branches:  trunk
changeset: 474511:69dc93af2625
user:      christos <christos%NetBSD.org@localhost>
date:      Fri Jul 09 03:05:49 1999 +0000

description:
compile with WARNS = 2

diffstat:

 bin/sh/Makefile     |   3 +-
 bin/sh/arith.y      |  14 +++++-----
 bin/sh/cd.c         |   8 +++---
 bin/sh/error.c      |  25 ++++++++++---------
 bin/sh/error.h      |   8 +++---
 bin/sh/eval.c       |  13 +++++----
 bin/sh/exec.c       |  64 ++++++++++++++++++++++++++-------------------------
 bin/sh/exec.h       |  11 ++++----
 bin/sh/expand.c     |  20 ++++++++--------
 bin/sh/expand.h     |   4 +-
 bin/sh/histedit.c   |  25 +++++++++++--------
 bin/sh/input.c      |  13 +++++----
 bin/sh/input.h      |   4 +-
 bin/sh/jobs.c       |  15 ++++++-----
 bin/sh/mail.c       |   6 ++--
 bin/sh/main.c       |  10 ++++----
 bin/sh/mkbuiltins   |   4 +-
 bin/sh/mktokens     |   7 +++--
 bin/sh/myhistedit.h |   4 +-
 bin/sh/mystring.c   |   6 ++--
 bin/sh/options.c    |  21 ++++++++--------
 bin/sh/options.h    |   6 ++--
 bin/sh/parser.c     |  65 ++++++++++++++++++++++------------------------------
 bin/sh/parser.h     |   4 +-
 bin/sh/var.c        |  52 ++++++++++++++++++++++-------------------
 bin/sh/var.h        |  12 ++++----
 26 files changed, 215 insertions(+), 209 deletions(-)

diffs (truncated from 1449 to 300 lines):

diff -r 0c07429b584d -r 69dc93af2625 bin/sh/Makefile
--- a/bin/sh/Makefile   Fri Jul 09 02:37:26 1999 +0000
+++ b/bin/sh/Makefile   Fri Jul 09 03:05:49 1999 +0000
@@ -1,6 +1,7 @@
-#      $NetBSD: Makefile,v 1.48 1999/02/05 22:19:47 tron Exp $
+#      $NetBSD: Makefile,v 1.49 1999/07/09 03:05:49 christos Exp $
 #      @(#)Makefile    8.4 (Berkeley) 5/5/95
 
+WARNS=2
 YHEADER=1
 PROG=  sh
 SHSRCS=        alias.c cd.c echo.c error.c eval.c exec.c expand.c \
diff -r 0c07429b584d -r 69dc93af2625 bin/sh/arith.y
--- a/bin/sh/arith.y    Fri Jul 09 02:37:26 1999 +0000
+++ b/bin/sh/arith.y    Fri Jul 09 03:05:49 1999 +0000
@@ -1,5 +1,5 @@
 %{
-/*     $NetBSD: arith.y,v 1.12 1999/02/05 07:52:52 christos Exp $      */
+/*     $NetBSD: arith.y,v 1.13 1999/07/09 03:05:49 christos Exp $      */
 
 /*-
  * Copyright (c) 1993
@@ -42,7 +42,7 @@
 #if 0
 static char sccsid[] = "@(#)arith.y    8.3 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: arith.y,v 1.12 1999/02/05 07:52:52 christos Exp $");
+__RCSID("$NetBSD: arith.y,v 1.13 1999/07/09 03:05:49 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -53,9 +53,9 @@
 #include "output.h"
 #include "memalloc.h"
 
-char *arith_buf, *arith_startbuf;
+const char *arith_buf, *arith_startbuf;
 
-void yyerror __P((char *));
+void yyerror __P((const char *));
 int yyparse __P((void));
 #ifdef TESTARITH
 int main __P((int , char *[]));
@@ -64,7 +64,7 @@
 
 int
 arith(s)
-       char *s;
+       const char *s;
 {
        long result;
 
@@ -87,7 +87,7 @@
        int argc;
        char **argv;
 {
-       char *p;
+       const char *p;
        char *concat;
        char **ap;
        long i;
@@ -192,7 +192,7 @@
 %%
 void
 yyerror(s)
-       char *s;
+       const char *s;
 {
 
        yyerrok;
diff -r 0c07429b584d -r 69dc93af2625 bin/sh/cd.c
--- a/bin/sh/cd.c       Fri Jul 09 02:37:26 1999 +0000
+++ b/bin/sh/cd.c       Fri Jul 09 03:05:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cd.c,v 1.26 1998/07/28 11:41:52 mycroft Exp $  */
+/*     $NetBSD: cd.c,v 1.27 1999/07/09 03:05:49 christos Exp $ */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)cd.c       8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: cd.c,v 1.26 1998/07/28 11:41:52 mycroft Exp $");
+__RCSID("$NetBSD: cd.c,v 1.27 1999/07/09 03:05:49 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -83,8 +83,8 @@
        int argc;
        char **argv;
 {
-       char *dest;
-       char *path;
+       const char *dest;
+       const char *path;
        char *p;
        struct stat statb;
        int print = 0;
diff -r 0c07429b584d -r 69dc93af2625 bin/sh/error.c
--- a/bin/sh/error.c    Fri Jul 09 02:37:26 1999 +0000
+++ b/bin/sh/error.c    Fri Jul 09 03:05:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: error.c,v 1.21 1999/04/05 15:00:28 mycroft Exp $       */
+/*     $NetBSD: error.c,v 1.22 1999/07/09 03:05:49 christos Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)error.c    8.2 (Berkeley) 5/4/95";
 #else
-__RCSID("$NetBSD: error.c,v 1.21 1999/04/05 15:00:28 mycroft Exp $");
+__RCSID("$NetBSD: error.c,v 1.22 1999/07/09 03:05:49 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -72,7 +72,8 @@
 char *commandname;
 
 
-static void exverror __P((int, char *, va_list)) __attribute__((__noreturn__));
+static void exverror __P((int, const char *, va_list))
+    __attribute__((__noreturn__));
 
 /*
  * Called to raise an exception.  Since C doesn't include exceptions, we
@@ -130,7 +131,7 @@
 static void
 exverror(cond, msg, ap)
        int cond;
-       char *msg;
+       const char *msg;
        va_list ap;
 {
        CLEAR_PENDING_INT;
@@ -156,7 +157,7 @@
 
 #ifdef __STDC__
 void
-error(char *msg, ...)
+error(const char *msg, ...)
 #else
 void
 error(va_alist)
@@ -164,14 +165,14 @@
 #endif
 {
 #ifndef __STDC__
-       char *msg;
+       const char *msg;
 #endif
        va_list ap;
 #ifdef __STDC__
        va_start(ap, msg);
 #else
        va_start(ap);
-       msg = va_arg(ap, char *);
+       msg = va_arg(ap, const char *);
 #endif
        exverror(EXERROR, msg, ap);
        /* NOTREACHED */
@@ -181,7 +182,7 @@
 
 #ifdef __STDC__
 void
-exerror(int cond, char *msg, ...)
+exerror(int cond, const char *msg, ...)
 #else
 void
 exerror(va_alist)
@@ -190,7 +191,7 @@
 {
 #ifndef __STDC__
        int cond;
-       char *msg;
+       const char *msg;
 #endif
        va_list ap;
 #ifdef __STDC__
@@ -198,7 +199,7 @@
 #else
        va_start(ap);
        cond = va_arg(ap, int);
-       msg = va_arg(ap, char *);
+       msg = va_arg(ap, const char *);
 #endif
        exverror(cond, msg, ap);
        /* NOTREACHED */
@@ -214,7 +215,7 @@
 struct errname {
        short errcode;          /* error number */
        short action;           /* operation which encountered the error */
-       char *msg;              /* text describing the error */
+       const char *msg;        /* text describing the error */
 };
 
 
@@ -281,7 +282,7 @@
  * Action describes the operation that got the error.
  */
 
-char *
+const char *
 errmsg(e, action)
        int e;
        int action;
diff -r 0c07429b584d -r 69dc93af2625 bin/sh/error.h
--- a/bin/sh/error.h    Fri Jul 09 02:37:26 1999 +0000
+++ b/bin/sh/error.h    Fri Jul 09 03:05:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: error.h,v 1.12 1998/07/28 11:41:53 mycroft Exp $       */
+/*     $NetBSD: error.h,v 1.13 1999/07/09 03:05:49 christos Exp $      */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -92,9 +92,9 @@
 
 void exraise __P((int)) __attribute__((__noreturn__));
 void onint __P((void));
-void error __P((char *, ...)) __attribute__((__noreturn__));
-void exerror __P((int, char *, ...)) __attribute__((__noreturn__));
-char *errmsg __P((int, int));
+void error __P((const char *, ...)) __attribute__((__noreturn__));
+void exerror __P((int, const char *, ...)) __attribute__((__noreturn__));
+const char *errmsg __P((int, int));
 
 
 /*
diff -r 0c07429b584d -r 69dc93af2625 bin/sh/eval.c
--- a/bin/sh/eval.c     Fri Jul 09 02:37:26 1999 +0000
+++ b/bin/sh/eval.c     Fri Jul 09 03:05:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eval.c,v 1.46 1999/06/26 16:31:47 christos Exp $       */
+/*     $NetBSD: eval.c,v 1.47 1999/07/09 03:05:49 christos Exp $       */
 
 /*-
  * Copyright (c) 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)eval.c     8.9 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: eval.c,v 1.46 1999/06/26 16:31:47 christos Exp $");
+__RCSID("$NetBSD: eval.c,v 1.47 1999/07/09 03:05:49 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -684,7 +684,7 @@
                cmdentry.u.index = BLTINCMD;
        } else {
                static const char PATH[] = "PATH=";
-               char *path = pathval();
+               const char *path = pathval();
 
                /*
                 * Modify the command lookup path, if a PATH= assignment
@@ -764,9 +764,10 @@
                localvars = NULL;
                INTON;
                if (setjmp(jmploc.loc)) {
-                       if (exception == EXSHELLPROC)
-                               freeparam((struct shparam *)&saveparam);
-                       else {
+                       if (exception == EXSHELLPROC) {
+                               freeparam((volatile struct shparam *)
+                                   &saveparam);
+                       } else {
                                freeparam(&shellparam);
                                shellparam = saveparam;
                        }
diff -r 0c07429b584d -r 69dc93af2625 bin/sh/exec.c
--- a/bin/sh/exec.c     Fri Jul 09 02:37:26 1999 +0000
+++ b/bin/sh/exec.c     Fri Jul 09 03:05:49 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec.c,v 1.26 1998/07/28 11:41:54 mycroft Exp $        */
+/*     $NetBSD: exec.c,v 1.27 1999/07/09 03:05:49 christos Exp $       */
 
 /*-
  * Copyright (c) 1991, 1993
@@ -41,7 +41,7 @@
 #if 0
 static char sccsid[] = "@(#)exec.c     8.4 (Berkeley) 6/8/95";
 #else
-__RCSID("$NetBSD: exec.c,v 1.26 1998/07/28 11:41:54 mycroft Exp $");
+__RCSID("$NetBSD: exec.c,v 1.27 1999/07/09 03:05:49 christos Exp $");
 #endif
 #endif /* not lint */
 
@@ -117,10 +117,10 @@
  */
 
 void
-shellexec(argv, envp, path, index)
+shellexec(argv, envp, path, idx)
        char **argv, **envp;
-       char *path;
-       int index;
+       const char *path;
+       int idx;
 {



Home | Main Index | Thread Index | Old Index