diff options
author | nectar <nectar@FreeBSD.org> | 2003-04-22 22:19:05 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2003-04-22 22:19:05 +0000 |
commit | f8d29b7a2912ec08869f47453b28431292a0534e (patch) | |
tree | e6ed84f3e88006395757c3507937924c3e1ac4aa | |
parent | 6fa234aec919187607467d59ce430d63f5efbcdf (diff) | |
download | FreeBSD-src-f8d29b7a2912ec08869f47453b28431292a0534e.zip FreeBSD-src-f8d29b7a2912ec08869f47453b28431292a0534e.tar.gz |
``Strong typing is a crutch for people with weak memories.''
Correct a bug that should have wreaked havoc everywhere, but for
some reason only bit unlucky people who use `-march' optimizations.
The compiler cannot assist one in distinguishing between the two
function calls below.
int nsdispatch(void *, ...);
void *discard;
nsdispatch(&discard, ...); /* correct .. no, really! */
nsdispatch(discard, ...); /* Boom */
Robin provided me with a debugging environment in which I could see
what was going on.
Badness when using CPUTYPE was
Reported by: "Robin P. Blanchard" <Robin.Blanchard@gactr.uga.edu>
Reported by: nork
Sponsored by: DARPA, Network Associates Laboratories
-rw-r--r-- | lib/libc/gen/getgrent.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/gen/getgrent.c b/lib/libc/gen/getgrent.c index ca95e55..42cffa0 100644 --- a/lib/libc/gen/getgrent.c +++ b/lib/libc/gen/getgrent.c @@ -929,12 +929,12 @@ docompat: errnop); break; case nss_lt_id: - rv = _nsdispatch(discard, dtab, NSDB_GROUP_COMPAT, + rv = _nsdispatch(&discard, dtab, NSDB_GROUP_COMPAT, "getgrgid_r", compatsrc, gid, grp, buffer, bufsize, errnop); break; case nss_lt_name: - rv = _nsdispatch(discard, dtab, NSDB_GROUP_COMPAT, + rv = _nsdispatch(&discard, dtab, NSDB_GROUP_COMPAT, "getgrnam_r", compatsrc, name, grp, buffer, bufsize, errnop); break; @@ -945,7 +945,7 @@ docompat: break; case COMPAT_MODE_NAME: set_lookup_type(dtab, nss_lt_name); - rv = _nsdispatch(discard, dtab, NSDB_GROUP_COMPAT, + rv = _nsdispatch(&discard, dtab, NSDB_GROUP_COMPAT, "getgrnam_r", compatsrc, st->name, grp, buffer, bufsize, errnop); switch (rv) { |