Path: 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: <13094@smoke.BRL.MIL> Organization: NEC Information Systems Australia Pty. Ltd. Lines: 26 In article 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...''