🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.4bsd
Article #238

Re: Bug in users command

#238
From: Norman Diamond
Date: Thu, 24 Jan 1991 01:09
37 lines
2297 bytes
In article <18981@rpp386.cactus.org> jfh@rpp386.cactus.org (John F Haugh II) writes:
>In article <6182:Jan2222:06:3991@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>>For comp.std.c readers: This argument started when I said that the BSD
>>users.c appears to be incorrect. It passes a two-dimensional character
>>array to qsort(), but the comparison function was expecting just a
>>pointer to characters. John says that's correct.

This is a tough one, and I don't dare to express an opinion yet.
But it's interesting to notice that certain well-known less careful
language lawyers also haven't answered this one yet.

>According to the standard, a pointer to a character or a pointer to
>a void is being passed.

Obviously.  And the question is, are
  char *a;
and
  char (*b)[35];
required to have the same representation, or perhaps even be treated
as compatible.

>There is no mechanism in the standard to
>create a pointer to an arbitrary object,

This is false, though.  This is why the preceding question exists.
Given
  char c[35];
b and &c have the same type.  (Most, if not all, pre-ANSI compilers
did not do this, but these are irrelevant.)

>or to find out the type of
>an object which has been passed to you.

This is true too, but irrelevant.
--
Norman Diamond       diamond@tkov50.enet.dec.com
If this were the company's opinion, I wouldn't be allowed to post it.
Technical Details
Message-ID: <1991Jan24.010957.18693@tkou02.enet.dec.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!olivea!samsung!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond
References: <18965@rpp386.cactus.org> <24748:Jan2016:53:4291@kramden.acf.nyu.edu> <18969@rpp386.cactus.org> <6182:Jan2222:06:3991@kramden.acf.nyu.edu> <18981@rpp386.cactus.org>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!bu.edu!olivea!samsung!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!shlump.nac.dec.com!tkou02.enet.dec.com!jit345!diamond
From: diamond@jit345.swstokyo.dec.com (Norman Diamond)
Newsgroups: comp.bugs.4bsd,comp.std.c
Subject: Re: Bug in users command
Message-ID: <1991Jan24.010957.18693@tkou02.enet.dec.com>
Date: 24 Jan 91 01:09:57 GMT
References: <18965@rpp386.cactus.org> <24748:Jan2016:53:4291@kramden.acf.nyu.edu> <18969@rpp386.cactus.org> <6182:Jan2222:06:3991@kramden.acf.nyu.edu> <18981@rpp386.cactus.org>
Sender: news@tkou02.enet.dec.com (USENET News System)
Reply-To: diamond@jit345.enet@tkou02.enet.dec.com (Norman Diamond)
Organization: Digital Equipment Corporation Japan , Tokyo
Lines: 37