Subject: Fixes for Dec-2
To: None <current-users@sun-lamp.cs.berkeley.edu>
From: None <Mark_Weaver@brown.edu>
List: current-users
Date: 12/03/1993 00:24:45
There were a lot of places that were screwed up because of the changes
in stdio.h.  The following are all because of sys_errlist:

----------------------------------------------------------------------
diff -c  ./bin/ed/ed.h.mhw1 ./bin/ed/ed.h
*** ./bin/ed/ed.h.mhw1	Thu Dec  2 06:36:46 1993
--- ./bin/ed/ed.h	Thu Dec  2 19:06:41 1993
***************
*** 248,253 ****
  void unset_active_nodes __P((line_t *, line_t *));
  long write_file __P((long, long, char *, char *));
  
! extern char *sys_errlist[];
  extern int mutex;
  extern int sigflags;
--- 248,253 ----
  void unset_active_nodes __P((line_t *, line_t *));
  long write_file __P((long, long, char *, char *));
  
! extern const char *const sys_errlist[];
  extern int mutex;
  extern int sigflags;
diff -c  ./usr.sbin/config.new/util.c.mhw1 ./usr.sbin/config.new/util.c
*** ./usr.sbin/config.new/util.c.mhw1	Sun Nov  7 05:24:45 1993
--- ./usr.sbin/config.new/util.c	Thu Dec  2 19:47:38 1993
***************
*** 263,269 ****
  }
  
  #include <errno.h>
! extern char *sys_errlist[];
  
  char *strerror(int errnum)
  {
--- 263,269 ----
  }
  
  #include <errno.h>
! extern const char *const sys_errlist[];
  
  char *strerror(int errnum)
  {
diff -c  ./gnu/usr.bin/gcc2/cc/gcc.c.mhw1 ./gnu/usr.bin/gcc2/cc/gcc.c
*** ./gnu/usr.bin/gcc2/cc/gcc.c.mhw1	Thu Dec  2 17:49:53 1993
--- ./gnu/usr.bin/gcc2/cc/gcc.c	Thu Dec  2 15:13:40 1993
***************
*** 108,114 ****
  extern char *getenv ();
  
  extern int errno, sys_nerr;
! extern char *sys_errlist[];
  
  extern int execv (), execvp ();
  
--- 108,114 ----
  extern char *getenv ();
  
  extern int errno, sys_nerr;
! extern const char *const sys_errlist[];
  
  extern int execv (), execvp ();
  
diff -c  ./gnu/usr.bin/gcc2/cpp/cccp.c.mhw1 ./gnu/usr.bin/gcc2/cpp/cccp.c
*** ./gnu/usr.bin/gcc2/cpp/cccp.c.mhw1	Sun Nov  7 02:54:52 1993
--- ./gnu/usr.bin/gcc2/cpp/cccp.c	Thu Dec  2 15:14:32 1993
***************
*** 191,197 ****
  extern char *version_string;
  extern struct tm *localtime ();
  extern int sys_nerr;
! extern char *sys_errlist[];
  
  #ifndef errno
  extern int errno;
--- 191,197 ----
  extern char *version_string;
  extern struct tm *localtime ();
  extern int sys_nerr;
! extern const char *const sys_errlist[];
  
  #ifndef errno
  extern int errno;
diff -c  ./gnu/usr.bin/groff/groff/pipeline.c.mhw1 ./gnu/usr.bin/groff/groff/pipeline.c
*** ./gnu/usr.bin/groff/groff/pipeline.c.mhw1	Sun Nov  7 03:04:05 1993
--- ./gnu/usr.bin/groff/groff/pipeline.c	Thu Dec  2 20:53:20 1993
***************
*** 235,241 ****
  {
    static char buf[sizeof("Signal ") + 1 + sizeof(int)*3];
  #ifdef HAVE_SYS_SIGLIST
!   extern char *sys_siglist[];
    if (n >= 0 && n < NSIG && sys_siglist[n] != 0)
      return sys_siglist[n];
  #endif /* HAVE_SYS_SIGLIST */
--- 235,241 ----
  {
    static char buf[sizeof("Signal ") + 1 + sizeof(int)*3];
  #ifdef HAVE_SYS_SIGLIST
!   extern const char *const sys_siglist[];
    if (n >= 0 && n < NSIG && sys_siglist[n] != 0)
      return sys_siglist[n];
  #endif /* HAVE_SYS_SIGLIST */
----------------------------------------------------------------------

I found the following patch on c.o.3.bugs from vandys@cisco.com.
I'm not too familiar with the backgammon source, but it definitely
looks like a bug to me.
----------------------------------------------------------------------
diff -c  ./games/backgammon/backgammon/move.c.mhw1 ./games/backgammon/backgammon/move.c
*** ./games/backgammon/backgammon/move.c.mhw1	Sun Nov  7 02:21:53 1993
--- ./games/backgammon/backgammon/move.c	Thu Dec  2 16:41:06 1993
***************
*** 355,360 ****
--- 355,361 ----
  
  	new = freeq;
  	freeq = freeq->b_next;
+ 	return (new);
  }
  
  pickmove ()  {
----------------------------------------------------------------------

I really have no idea why these #defines were put in there, so I don't
know if the following fixes are correct.  But they allowed the programs
to compile on my machine.
----------------------------------------------------------------------
diff -c  ./sbin/modload/modload.c.mhw1 ./sbin/modload/modload.c
*** ./sbin/modload/modload.c.mhw1	Wed Nov 24 05:58:05 1993
--- ./sbin/modload/modload.c	Thu Dec  2 19:34:20 1993
***************
*** 49,57 ****
   *	$Id: modload.c,v 1.3 1993/11/23 04:43:06 cgd Exp $
   */
  
- #define printf I_HATE_ANSI
  #include <stdio.h>
- #undef printf
  #include <stdlib.h>
  #include <sys/param.h>
  #include <sys/ioctl.h>
--- 49,55 ----
diff -c  ./sbin/modunload/modunload.c.mhw1 ./sbin/modunload/modunload.c
*** ./sbin/modunload/modunload.c.mhw1	Sun Nov  7 03:42:15 1993
--- ./sbin/modunload/modunload.c	Thu Dec  2 19:37:00 1993
***************
*** 46,54 ****
   *	$Id: modunload.c,v 1.2 1993/06/07 23:10:37 cgd Exp $
   */
  
- #define printf I_HATE_ANSI
  #include <stdio.h>
- #undef printf
  #include <stdlib.h>
  #include <sys/param.h>
  #include <sys/ioctl.h>
--- 46,52 ----
diff -c  ./usr.bin/modstat/modstat.c.mhw1 ./usr.bin/modstat/modstat.c
*** ./usr.bin/modstat/modstat.c.mhw1	Sun Nov  7 05:06:59 1993
--- ./usr.bin/modstat/modstat.c	Thu Dec  2 19:38:47 1993
***************
*** 46,54 ****
   *	$Id: modstat.c,v 1.1 1993/06/07 19:52:58 cgd Exp $
   */
  
- #define printf I_HATE_ANSI
  #include <stdio.h>
- #undef printf
  #include <stdlib.h>
  #include <sys/param.h>
  #include <sys/ioctl.h>
--- 46,52 ----
----------------------------------------------------------------------

This temporary place-holder is needed to make the kernel compile with
the speaker pseudo-device.
----------------------------------------------------------------------
diff -c  ./sys/arch/i386/isa/spkr.c.mhw1 ./sys/arch/i386/isa/spkr.c
*** ./sys/arch/i386/isa/spkr.c.mhw1	Sun Nov  7 04:08:07 1993
--- ./sys/arch/i386/isa/spkr.c	Thu Dec  2 13:51:27 1993
***************
*** 500,504 ****
--- 500,508 ----
      return(0);
  }
  
+ void speakerattach(int dummy)
+ {
+ }
+ 
  #endif  /* NSPEAKER > 0 */
  /* spkr.c ends here */
----------------------------------------------------------------------

The following patch I am not sure about, but it seems to be an
improvement on my system.  "mkdep" doesn't define the same
preprocessor symbols as "cc" does during compiling, which could lead
to incorrect dependencies being generated.  The following patch makes
the default "depend" rules match the default compile rules.  It also
gets rid of a buttload of warnings that were generated during
"make depend" that didn't happen during "make".  For an example, try
"make depend" in gnu/usr.bin/gawk/.
----------------------------------------------------------------------
diff -c  ./share/mk/bsd.dep.mk.mhw1 ./share/mk/bsd.dep.mk
*** ./share/mk/bsd.dep.mk.mhw1	Sun Nov  7 03:56:13 1993
--- ./share/mk/bsd.dep.mk	Thu Dec  2 17:00:11 1993
***************
*** 12,22 ****
  	fi
  	files="${.ALLSRC:M*.c}"; \
  	if [ "$$files" != "" ]; then \
! 	  mkdep -a ${MKDEP} ${CFLAGS:M-[ID]*} $$files; \
  	fi
  	files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
  	if [ "$$files" != "  " ]; then \
! 	  mkdep -a ${MKDEP} -+ ${CXXFLAGS:M-[ID]*} $$files; \
  	fi
  .else
  .depend:
--- 12,22 ----
  	fi
  	files="${.ALLSRC:M*.c}"; \
  	if [ "$$files" != "" ]; then \
! 	  ${CC} -M ${CFLAGS} $$files >> .depend; \
  	fi
  	files="${.ALLSRC:M*.cc} ${.ALLSRC:M*.C} ${.ALLSRC:M*.cxx}"; \
  	if [ "$$files" != "  " ]; then \
! 	  ${CXX} -M ${CXXFLAGS} $$files >> .depend; \
  	fi
  .else
  .depend:
----------------------------------------------------------------------


------------------------------------------------------------------------------