Path: utzoo!mnetor!uunet!husc6!hao!oddjob!gargoyle!ihnp4!alberta!auvax!rwa From: rwa@auvax.UUCP (Ross Alexander) Newsgroups: comp.lang.c Subject: Re: Possible extension to C?? Message-ID: <504@auvax.UUCP> Date: 18 Jan 88 00:57:21 GMT References: <3306@ihlpf.ATT.COM> <28700023@ccvaxa> Organization: Athabasca U., Alberta, Canada Lines: 27 Summary: *0 should generate SIG In article <28700023@ccvaxa>, aglew@ccvaxa.UUCP writes: > Which should it be, SIGBUS or SIGSEGV? What I was really driving at was that `( *) 0' is a perfectly OK lvalue but shouldn't be expected to have an rvalue on an arbitrary implementation. In fact, I think (as a general rule) that references to the rvalue `*0' should be considered logic errors. Some previous comments ( re plugging interrupt vectors and so on ) demonstrate a need to handle `*0' from time to time, but I certainly would like the default behaviour to be a signal of some flavour; if SIGSEGV is posix-conformant, then SIGSEGV is fine by me. After all, if you have anything like a decent memory managment facility, this check is free ( even an Atari ST can generate the SIG, for crying out loud ), and there are few enough run-time rationality checks in C as things stand :-) Possibly an implementation could control the signal-generation via an ioctl() on /dev/mem or some such kluge, if there was a real need to get at *0. I don't want to tie anyone's hands (`the programmer is always right' shall be the whole of the law :-). Pardon me if all this speculation and handwaving is prior art... -- Ross Alexander, Athabasca University, alberta!auvax!rwa