0 and pointers.( Re: Abandon NULL for (0))

Dave Decot decot at hpisod2.HP.COM
Fri Oct 13 09:29:56 AEST 1989


> They were probably following BSD's lead.  BSD UNIX at one point started
> passing additional information to signal handlers for certain classes of
> signals (e.g. FPE exceptions).  This is horribly nonportable, as is
> treating fixed-argument functions the same as variadic functions.
> 
> Anyway, it's wrong.  The standard signal() function's signal handlers
> are NOT variadic; they receive precisely one int argument.

This is why many operating systems on which C is used have had to add
some other interface (or if they can do it compatibly, add arguments to
the handling function) to workaround this design defect.  I don't know how
"horribly" non-portable this usage is, since many systems seem to be able
to acheive it, but if the standard defined something useful, there
wouldn't be as much need to invent non-portable ways to get the job done.

Dave Decot



More information about the Comp.lang.c mailing list