TIP: Click on subject to list as thread! ANSI
echo: aust_c_here
to: Frank Adam
from: Paul Edwards
date: 1996-10-04 11:10:18
subject: using ctrlbrk()

PE> Well, you got me to look up my standard, but unless your section
PE> 7.7.1.1 is  different from mine, the return value from your handler is 
PE> irrelevant.  Actually, not so much irrelevant as ILLEGAL.  
FA> From memory he was asking about ctrlbrk(), which is a borland function, 

Fair enough.

PE> The signal handler is meant to be of return type "void".
FA> I did look at ANSI, i presume you meant 4.7.1.1. 

To convert ISO to ANSI, subtract 3 from the high-level number, and you will
almost always be right.

FA> I'm back to my normal confused state now, the function definition does 
FA> indicate a void func..
FA> void (*signal(int sig, void (*func)(int)))(int);

FA> That sounds a bit contradictory, how can a void func(whatever) execute 
FA> a return statement ?  

By going "return;"!  Didn't you know you could put a return
statement in a void function?  Especially used if you want to return from
multiple places within the function.  Personally I put it in all the time,
to avoid getting warnings from IBM's C/370 compiler, which thinks that it's
a good idea to always put them in.

BFN.  Paul.
@EOT:

---
* Origin: X (3:711/934.9)

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.