Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!husc6!cmcl2!rutgers!uwvax!rhesus!dubois From: dubois@rhesus.primate.wisc.edu (Paul DuBois) Newsgroups: comp.sources.bugs Subject: Declaration errors in less + Fix Message-ID: <237@rhesus.primate.wisc.edu> Date: Thu, 10-Sep-87 14:13:46 EDT Article-I.D.: rhesus.237 Posted: Thu Sep 10 14:13:46 1987 Date-Received: Sat, 12-Sep-87 09:35:35 EDT Organization: The Ancient Harmonies Lines: 78 The recent posting of less did not compile correctly on my system. (Ultrix 1.2 on a VAX 8200). The file os.c got three redeclaration errors, for NULL, EOF and sprintf. The redeclaration for NULL is ignorable, since less.h defines it the same way as , but EOF was defined as 0 (!!) in less.h. The sprintf error was because stdio.h is not pulled into os.c until after sprintf is used (thus assumed to be an int function by the compiler), and the char* declaration in stdio.h results in a conflict. Patches to fix found below. They're quite trivial - define EOF correctly, and move the #include for stdio.h to the top of os.c. *** less.h.orig Thu Sep 10 12:33:10 1987 --- less.h Thu Sep 10 12:33:30 1987 *************** *** 24,30 #define FILENAME 128 /* Max size of a filename */ ! #define EOF (0) #define NULL (0) /* How quiet should we be? */ --- 24,30 ----- #define FILENAME 128 /* Max size of a filename */ ! #define EOF (-1) /* was 0! */ #define NULL (0) /* How quiet should we be? */ *** os.c.orig Thu Sep 10 12:33:38 1987 --- os.c Thu Sep 10 12:34:12 1987 *************** *** 10,15 * Unix features are present. */ #include "less.h" #include --- 10,19 ----- * Unix features are present. */ + #if GLOB + #include + #endif + #include "less.h" #include *************** *** 94,100 */ #if GLOB ! #include FILE *popen(); public char * --- 98,104 ----- */ #if GLOB ! /*#include */ FILE *popen(); public char * --- Paul DuBois UUCP: {allegra,ihnp4,seismo}!uwvax!rhesus!dubois | ARPA: dubois@rhesus.primate.wisc.edu --+-- | "Hard work isn't easy." --Mrs. O. |