home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!zaphod.mps.ohio-state.edu!uwm.edu!linac!att!att!allegra!alice!ark
- From: ark@alice.att.com (Andrew Koenig)
- Newsgroups: comp.lang.c
- Subject: Re: Is this ANSI?
- Message-ID: <24262@alice.att.com>
- Date: 20 Nov 92 23:03:04 GMT
- Article-I.D.: alice.24262
- References: <9eRguB1w165w@quest.UUCP> <24238@alice.att.com> <By0vu2.7AF@unx.sas.com>
- Reply-To: ark@alice.UUCP ()
- Organization: AT&T Bell Laboratories, Murray Hill NJ
- Lines: 26
-
- In article <By0vu2.7AF@unx.sas.com> sasghm@theseus.unx.sas.com (Gary Merrill) writes:
-
- > I think "does not allow that technique" is a little strong. What you
- > *can* do is
-
- struct FM
- {
- short data_len;
- char data[1];
- };
-
- struct FM *fmptr;
-
- fmptr = malloc( sizeof(struct FM) + ??? );
-
- > where the ??? is the number of bytes of your data minus 1. Some may
- > regard this as "impure", but it is not forbidden by the standard and
- > is eminently portable.
-
- Oh, really? Can you give me concrete evidence that the C standard allows it?
-
- More specifically, after executing the code above, can you give me
- evidence that referrint to fmptr->data[i] is allowed when i>1?
- --
- --Andrew Koenig
- ark@europa.att.com
-