Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!ginosko!uunet!crdgw1!crdos1!davidsen From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr) Newsgroups: comp.unix.questions Subject: Re: SunOS: 1; portability: 0 Message-ID: <478@crdos1.crd.ge.COM> Date: 25 Sep 89 14:11:00 GMT References: <880@cirrusl.UUCP> Reply-To: davidsen@crdos1.UUCP (bill davidsen) Organization: GE Corp R&D Center Lines: 21 In article <880@cirrusl.UUCP>, dhesi@sun505.UUCP (Rahul Dhesi) writes: | For about ten years, signal() has been a function returning pointer to | int. It worked, and we were all happily writing portable code. Actually I think you mean "pointer to function returning int." Since the value of the pointer to proc is used, and a pointer to any proc type can hold the address of any other proc type, I don't see that the question ever comes up. Your existing code will work fine, since the declaration is in signal.h and you can still save the value returned by signal in a variable declared int (*sighold)(); without portability problems. Some compilers may warn you about this but you can always say sighold = (int (*)())signal(SIGALRM, myproc); which is the correct ugly cast of types. -- bill davidsen (davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen) "The world is filled with fools. They blindly follow their so-called 'reason' in the face of the church and common sense. Any fool can see that the world is flat!" - anon