Path: ...!feeds.phibee-telecom.net!2.eu.feeder.erje.net!feeder.erje.net!newsfeed.bofh.team!paganini.bofh.team!not-for-mail From: antispam@fricas.org (Waldek Hebisch) Newsgroups: comp.lang.c Subject: Re: Did you get confused again? You seem eaily bewildered. Date: Mon, 28 Apr 2025 10:39:07 -0000 (UTC) Organization: To protect and to server Message-ID: References: Injection-Date: Mon, 28 Apr 2025 10:39:07 -0000 (UTC) Injection-Info: paganini.bofh.team; logging-data="1434769"; posting-host="WwiNTD3IIceGeoS5hCc4+A.user.paganini.bofh.team"; mail-complaints-to="usenet@bofh.team"; posting-account="9dIQLXBM7WM9KzA+yjdR4A"; User-Agent: tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64)) X-Notice: Filtered by postfilter v. 0.9.3 Bytes: 2719 Lines: 40 Bonita Montero wrote: > Am 27.04.2025 um 16:43 schrieb Kenny McCormack: >> In article , >> Bonita Montero wrote >>> Am 27.04.2025 um 15:33 schrieb Bonita Montero: >>> >>>> The platform with the most comfortable handling of division by zeroes >>>> is Windows. Win32 allows to catch that errors easily, whereas with >>>> Posix it's hard to continue the code in the same function or with >>>> a calling function. >>> >>> #include >> >> Burp! >> >>> #include >>> >>> using namespace std; >> >> Burp again! Are you confused about which newsgroup this is? > > Ignore it it you target a different platform. But it would be nice > if such problems were handleable that convenient in any lanugage. > This C-addition exists since the beginning of the 1993, when NT > 3.1 was born. With Unix you'd have to use signals, wich are totally > ugly since you couln't return to a different execution-context in > the same function. I am not sure how much can be done with Posix functions, but any self-respectiong Unix allows you essentially the same freedom as hardware exception handler. That is you can change CPU registers and program memory in whatever way you need and then restart the program. If you change program counter to point to handler code within the faulting function, then you will restart the current function. Of course, C has no standard way to define a handler, for this you need different language or some nonstandard extention. -- Waldek Hebisch