Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site utcsri.UUCP Path: utzoo!utcsri!greg From: greg@utcsri.UUCP (Gregory Smith) Newsgroups: net.lang.c Subject: Re: Address of array Message-ID: <2629@utcsri.UUCP> Date: Thu, 24-Apr-86 23:07:39 EST Article-I.D.: utcsri.2629 Posted: Thu Apr 24 23:07:39 1986 Date-Received: Fri, 25-Apr-86 00:49:01 EST References: <153@brl-smoke.ARPA> Reply-To: greg@utcsri.UUCP (Gregory Smith) Organization: CSRI, University of Toronto Lines: 25 Summary: why would jmp_buf be defined as a struct? In article <153@brl-smoke.ARPA> gwyn@BRL.ARPA writes: >typedef struct { whatever-you-need } jmp_buf[1]; > >solves the problem of the way setjmp()'s parameter is used, >with completely type-correct implementation (in the >"whatever-you-need" part). Too bad setjmp() was defined >as taking an array parameter in the first place. I've been wondering about this... Why would you need to define jmp_buf as a structure? It seems (1) it is impossible to write setjump or longjmp in C (2) the contents of the buffer are completely non-portable, so any program that looks at or alters them is non-portable (3) you can't do anything useful with them anyway, from C. All jmp_buf is is a certain amount of space, as far as C needs to be concerned. I think point (3) is a bit shaky - the contents just might be useful in certain inherently non-portable code. And it would be nice, I agree, if jmp_buf had been defined as a structure - if only to allow easy copying of jmp_buf records. A definition might look like `typedef struct{ char *dummy[11];} jmp_buf;'. But are there cases where a structure was used out of necessity? -- "For every action there is an equal and opposite malfunction" ---------------------------------------------------------------------- Greg Smith University of Toronto UUCP: ..utzoo!utcsri!greg