Path: utzoo!attcan!uunet!snorkelwacker!spdcc!ima!haddock!karl From: karl@haddock.ima.isc.com (Karl Heuer) Newsgroups: comp.std.c Subject: Re: fwrite(buf, 0, 42, stream) == ? Message-ID: <16979@haddock.ima.isc.com> Date: 27 Jun 90 21:04:55 GMT References: <3159@disk.UUCP> <25096@mimsy.umd.edu> <25105@mimsy.umd.edu> <6818@scolex.sco.COM> Reply-To: karl@haddock.ima.isc.com (Karl Heuer) Organization: Interactive Systems, Cambridge, MA 02138-5302 Lines: 17 In article <6818@scolex.sco.COM> seanf@sco.COM (Sean Fagan) writes: >In article <25105@mimsy.umd.edu> chris@mimsy.umd.edu (Chris Torek) writes: >>making fwrite(, 0, n) return n is inexpensive > >But is it *right*? > >How many bytes get written for a 0-sized object? What does ANSI say about >it? Do all of the committee members agree? 8-) Since ANSI says there's no such thing as a zero-sized object, it would seem that any behavior is right--including a core dump. If the implementation chooses to provide ZSOs as an extension, then the implementors should decide on a reasonable behavior and document it. If they want to be consistent with other people providing similar extensions, then they should discuss it with the X3J11 ZSO POC, which happens to be Doug Gwyn. Karl W. Z. Heuer (karl@kelp.ima.isc.com or ima!kelp!karl), The Walking Lint