Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!tektronix!hplabs!hpda!hpisoa2!hpitg!utcsri!greg@utcsri From: greg@utcsri Newsgroups: net.lang.c Subject: Re: Address of array Message-ID: <2629@utcsri> Date: Fri, 25-Apr-86 06:07:00 EDT Article-I.D.: utcsri.2629 Posted: Fri Apr 25 06:07:00 1986 Date-Received: Tue, 13-May-86 01:39:25 EDT References: <2439@utcsri> Lines: 25 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