* zsh 3.0.0 and gcc 1.42 bug
@ 1997-03-18 16:12 Keith Bostic
0 siblings, 0 replies; only message in thread
From: Keith Bostic @ 1997-03-18 16:12 UTC (permalink / raw)
To: zsh-workers
FYI, the following code in zsh-3.0.0/Src/subst.c:
ifdef HAVE_STRCOLL
# ifdef __GNUC__
char c[strlen(*(char **) a) + 1];
char d[strlen(*(char **) b) + 1];
# else
char *c = halloc(strlen(*(char **) a) + 1);
char *d = halloc(strlen(*(char **) b) + 1);
# endif
doesn't work under gcc 1.42. I've attached a test program. If
you flip the #if value, and compile with gcc 1.42, it will fail
or succeed.
We're switching to gcc 2 for everything RSN, but figured I'd
mention it in case you guys care.
--keith
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
int
cstrpcmp(const void *a, const void *b)
{
#if 1
char c[strlen(*(char **) a) + 1];
char d[strlen(*(char **) b) + 1];
#else
char c[20];
char d[20];
#endif
char *s, *t;
for (s = *(char **) a, t = c; (*t++ = tolower(*s++)););
for (s = *(char **) b, t = d; (*t++ = tolower(*s++)););
return (strcmp(c, d));
}
main()
{
char *a, *b;
a = "HUP";
b = "HUP";
printf("%d\n", cstrpcmp(&a, &b));
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1997-03-18 16:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-18 16:12 zsh 3.0.0 and gcc 1.42 bug Keith Bostic
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).