Article View: comp.std.c
Article #1434Re: fwrite(buf, 0, 42, stream) == ?
From: Boyd Roberts
Date: Fri, 15 Jun 1990 05:09
Date: Fri, 15 Jun 1990 05:09
26 lines
1249 bytes
1249 bytes
In article <F.-&asi@cs.psu.edu> flee@psuvax1.cs.psu.edu (Felix Lee) writes:
>Doug Gwyn wrote:
>>Strictly speaking, there are no semantics defined for such usage,
>
>Well, does that mean it's undefined or implementation defined? If the
>standard defines malloc(0), why not fwrite(p, 0, n, stream)?
>
Like the man said `there are no semantics defined'.
Successfully writing `n' objects of zero size? Just where will it all end?
I can see it now, `Programming in C+++':
fp = fopen("/dev/null", "r+");
p = malloc(0);
fread(p, 0, 42, fp);
p += 0;
fwrite(p, 0, 42, fp);
Choose a better _algorithm_ and leave library routine breaking to the experts.
Boyd Roberts boyd@necisa.ho.necisa.oz.au
``When the going gets wierd, the weird turn pro...''
Technical Details
Message-ID:
<1761@necisa.ho.necisa.oz>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!munnari.oz.au!metro!cluster!necisa!boydReferences:
<Fkucoph@cs.psu.edu> <13094@smoke.BRL.MIL> <F.-&asi@cs.psu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!munnari.oz.au!metro!cluster!necisa!boyd From: boyd@necisa.ho.necisa.oz (Boyd Roberts) Newsgroups: comp.std.c Subject: Re: fwrite(buf, 0, 42, stream) == ? Message-ID: <1761@necisa.ho.necisa.oz> Date: 15 Jun 90 05:09:43 GMT References: <Fkucoph@cs.psu.edu> <13094@smoke.BRL.MIL> <F.-&asi@cs.psu.edu> Organization: NEC Information Systems Australia Pty. Ltd. Lines: 26