From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from euclid.skiles.gatech.edu (list@euclid.skiles.gatech.edu [130.207.146.50]) by melb.werple.net.au (8.7.5/8.7.3) with ESMTP id GAA04208 for ; Wed, 8 May 1996 06:58:14 +1000 (EST) Received: (from list@localhost) by euclid.skiles.gatech.edu (8.7.3/8.7.3) id QAA22283; Tue, 7 May 1996 16:44:04 -0400 (EDT) Resent-Date: Tue, 7 May 1996 16:44:04 -0400 (EDT) From: Zoltan Hidvegi Message-Id: <199605072039.WAA24281@turan.elte.hu> Subject: Re: Compilation on Ultrix cc To: hniksic@public.srce.hr Date: Tue, 7 May 1996 22:39:51 +0200 (MET DST) Cc: zsh-workers@math.gatech.edu (Zsh workers list) In-Reply-To: <199605070206.EAA26805@jagor.srce.hr> from Hrvoje Niksic at "May 7, 96 04:06:57 am" Organization: Dept. of Comp. Sci., Eotvos University, Budapest, Hungary Phone: (36 1)2669833 ext: 2667, home phone: (36 1) 2752368 X-Mailer: ELM [version 2.4ME+ PL15 (25)] MIME-Version: 1.0 Content-Type: application/pgp; format=text; x-action=sign Content-Transfer-Encoding: 7bit Resent-Message-ID: <"e8GjX.0.5S5.FOxZn"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/1001 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu -----BEGIN PGP SIGNED MESSAGE----- > I'm sorry, but I compiled zsh with ultrix cc without using ansi2knr without > problems (except those described later). Ultrix cc understands ANSI function > declarations. There is a builtin autoconf test for ANSI C protorypes which fails with the Ulrtix CC since it does not define __STDC__. But the code generated by ansi2knr compiles fine so I'd rather not change it. If one does not like it he can use c89 or gcc. The patch below should remove the warnings on Ultix with cc. It removes the #ifdef ULTRIX lines from glob.c and always uses Statptr in place of struct stat *. I also removed the #error directive from builtin.c and repladed with comething which should generate a syntax error (but I hope that noone will see this error). Bye, Zoltan *** Src/builtin.c 1996/05/06 01:09:16 2.23 --- Src/builtin.c 1996/05/07 20:09:53 *************** *** 3535,3541 **** "memorylocked", # endif /* RLIMIT_MEMLOCK */ # if NEXT_RLIM != RLIM_NLIMITS ! # error there are some unknown limits. Fixme! # endif # undef NEXT_RLIM NULL --- 3535,3541 ---- "memorylocked", # endif /* RLIMIT_MEMLOCK */ # if NEXT_RLIM != RLIM_NLIMITS ! there are some unknown limits. Fixme! # endif # undef NEXT_RLIM NULL *************** *** 4050,4056 **** } /* -s option -- add the arguments to the history list */ if (ops['s']) { ! int nwords = 0, nlen, iword; char **pargs = args; permalloc(); --- 4050,4056 ---- } /* -s option -- add the arguments to the history list */ if (ops['s']) { ! int nwords = 0, nlen, iwords; char **pargs = args; permalloc(); *************** *** 4062,4072 **** nwords++; if ((ent->nwords = nwords)) { ent->words = (short *)zalloc(nwords*2*sizeof(short)); ! nlen = iword = 0; for (pargs = args; *pargs; pargs++) { ! ent->words[iword++] = nlen; nlen += strlen(*pargs); ! ent->words[iword++] = nlen; nlen++; } } else --- 4062,4072 ---- nwords++; if ((ent->nwords = nwords)) { ent->words = (short *)zalloc(nwords*2*sizeof(short)); ! nlen = iwords = 0; for (pargs = args; *pargs; pargs++) { ! ent->words[iwords++] = nlen; nlen += strlen(*pargs); ! ent->words[iwords++] = nlen; nlen++; } } else *************** *** 4609,4615 **** nchars = 1; /* handle the prompt string, if provided */ ! firstarg=*args; if (*args && **args == '?') args++; if (firstarg) { --- 4609,4615 ---- nchars = 1; /* handle the prompt string, if provided */ ! firstarg = *args; if (*args && **args == '?') args++; if (firstarg) { *** Src/input.c 1996/05/02 23:01:11 2.5 --- Src/input.c 1996/05/07 20:24:23 *************** *** 259,265 **** write(2, (WRITE_ARG_2_T)pptbuf, pptlen); free(pptbuf); } ! ingetcline = shingetline(); } else ingetcline = zleread((char *)ingetcpmptl, (char *)ingetcpmptr); if (!ingetcline) { --- 259,265 ---- write(2, (WRITE_ARG_2_T)pptbuf, pptlen); free(pptbuf); } ! ingetcline = (unsigned char *)shingetline(); } else ingetcline = zleread((char *)ingetcpmptl, (char *)ingetcpmptr); if (!ingetcline) { *** Src/zle_misc.c 1996/05/02 23:44:37 2.10 --- Src/zle_misc.c 1996/05/07 20:22:53 *************** *** 712,718 **** * buffer. It might be modified later. Note that bp isn't changed. */ for(ps=d, pd=bp; *ps; ps++) for(pc=nicechar(STOUC(*ps)); *pc; pc++) ! *pd++=*pc; if(!trunclen || dlen <= trunclen) { /* No truncation is needed, so update bp and return, * * leaving the full string in the prompt. */ --- 712,718 ---- * buffer. It might be modified later. Note that bp isn't changed. */ for(ps=d, pd=bp; *ps; ps++) for(pc=nicechar(STOUC(*ps)); *pc; pc++) ! *pd++ = *pc; if(!trunclen || dlen <= trunclen) { /* No truncation is needed, so update bp and return, * * leaving the full string in the prompt. */ *** Src/zle_tricky.c 1996/05/05 10:06:07 2.25 --- Src/zle_tricky.c 1996/05/07 20:01:27 *************** *** 2828,2837 **** /* Now search the history. */ while (n-- && (he = quietgethist(i--))) { ! int iword; ! for (iword = 0; iword < he->nwords; iword++) { ! h = he->text + he->words[iword*2]; ! e = he->text + he->words[iword*2+1]; hpatsav = *e; *e = '\0'; /* We now have a word from the history, ignore it if it --- 2828,2837 ---- /* Now search the history. */ while (n-- && (he = quietgethist(i--))) { ! int iwords; ! for (iwords = 0; iwords < he->nwords; iwords++) { ! h = he->text + he->words[iwords*2]; ! e = he->text + he->words[iwords*2+1]; hpatsav = *e; *e = '\0'; /* We now have a word from the history, ignore it if it *************** *** 2961,2978 **** else if (*nam == '(') { /* It's a (...) list, not a parameter name. */ char *ptr, *s, **uarr, **aptr; ! int count = 0, nonempty = 0, brk = 0; LinkList arrlist = newlinklist(); ptr = dupstring(nam); s = ptr + 1; while (*++ptr) { if (*ptr == '\\' && ptr[1]) ! chuck(ptr), nonempty++; else if (*ptr == ',' || inblank(*ptr) || *ptr == ')') { if (*ptr == ')') brk++; ! if (nonempty) { *ptr = '\0'; count++; if (*s == '\n') --- 2961,2978 ---- else if (*nam == '(') { /* It's a (...) list, not a parameter name. */ char *ptr, *s, **uarr, **aptr; ! int count = 0, notempty = 0, brk = 0; LinkList arrlist = newlinklist(); ptr = dupstring(nam); s = ptr + 1; while (*++ptr) { if (*ptr == '\\' && ptr[1]) ! chuck(ptr), notempty++; else if (*ptr == ',' || inblank(*ptr) || *ptr == ')') { if (*ptr == ')') brk++; ! if (notempty) { *ptr = '\0'; count++; if (*s == '\n') *************** *** 2980,2988 **** addlinknode(arrlist, s); } s = ptr + 1; ! nonempty = 0; } else ! nonempty++; if (brk) break; } --- 2980,2988 ---- addlinknode(arrlist, s); } s = ptr + 1; ! notempty = 0; } else ! notempty++; if (brk) break; } *** Src/glob.c 1996/05/02 23:00:33 2.9 --- Src/glob.c 1996/05/07 20:33:36 *************** *** 51,59 **** static dev_t old_dev; /* ) position in path in case */ static int old_pos; /* ) matching multiple directories */ - #ifdef ULTRIX typedef struct stat *Statptr; /* This makes the Ultrix compiler happy. Go figure. */ - #endif /* modifier for unit conversions */ --- 51,57 ---- *************** *** 162,174 **** /* bit 1 for follow links (2), don't (0) */ long data = 0; /* Any numerical argument required */ - #ifdef ULTRIX int (*func) _((Statptr, long)); - #else - int (*func) _((struct stat *, long)); - - #endif /* Check these are really qualifiers, not a set of * * alternatives or exclusions */ for (s = str + sl - 2; s != str; s--) --- 160,167 ---- *************** *** 179,189 **** /* Real qualifiers found. */ *s++ = '\0'; while (*s != Outpar && !colonmod) { - #ifdef ULTRIX func = (int (*) _((Statptr, long)))0; - #else - func = (int (*) _((struct stat *, long)))0; - #endif if (idigit(*s)) { /* Store numeric argument for qualifier */ func = qualflags; --- 172,178 ---- -----BEGIN PGP SIGNATURE----- Version: 2.6.2i iQCVAwUBMY+1EwupSCiLN749AQHivgQAj+h/ITCzT49Ma5zxJxD/xUkOedvT2HPx wJClaLGLK0VtvW9I8kKedPpJQI8PUneZeSsv1L702wKyGCXsOpTduRfwFQFlmJmP wjYdpXC2yCJa93j9KZLl9juhi6B6/PT51mEFUskE8ge4qxcNt9U86j46fX2n/3BJ DKkRwinmr44= =E726 -----END PGP SIGNATURE-----