Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utcsri!utgpu!woods From: woods@gpu.utcs.toronto.edu Newsgroups: comp.lang.c Subject: Re: zero length array Message-ID: <1987Feb25.201816.29714@gpu.utcs.toronto.edu> Date: Wed, 25-Feb-87 20:18:16 EST Article-I.D.: gpu.1987Feb25.201816.29714 Posted: Wed Feb 25 20:18:16 1987 Date-Received: Wed, 25-Feb-87 20:35:48 EST References: <4498@brl-adm.ARPA> Reply-To: woods@gpu.utcs.UUCP (Greg Woods) Organization: University of Toronto Computing Services Lines: 14 Keywords: NULL cast portability Checksum: 15653 Summary: NULL cast portability In article <4498@brl-adm.ARPA> Dizio@udel.edu writes: > Is the following a portable way of finding out where a field >within a structure is located? > > & (((struct any_struct_tag *) 0)->any_field) Not that I know of, though the expression without "&" is usefull in sizeof(). Some compilers will refuse to cast NULL, specifically Lattice C up to 2.15(?) As far as I know all Unix compilers will cast NULL. You might want to cast one(1) instead. Lattice will accept this. Greg Woods.