Possible extension to C??

Ross Alexander rwa at auvax.UUCP
Mon Jan 18 10:57:21 AEST 1988


In article <28700023 at ccvaxa>, aglew at ccvaxa.UUCP writes:
> Which should it be, SIGBUS or SIGSEGV?

What I was really driving at was that `(<arb-type-but-not-void> *) 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



More information about the Comp.lang.c mailing list