Deutsch   English   Français   Italiano  
<vunls9$1bp4h$2@paganini.bofh.team>

View for Bookmarking (what is this?)
Look up another Usenet article

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: <vunls9$1bp4h$2@paganini.bofh.team>
References: <vughb7$g6cm$1@dont-email.me> <vulbmd$t4di$1@raubtier-asyl.eternal-september.org> <vulcf3$tsqb$1@raubtier-asyl.eternal-september.org> <vulfqq$2cmtu$1@news.xmission.com> <vulgdf$11abk$1@raubtier-asyl.eternal-september.org>
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 <Bonita.Montero@gmail.com> wrote:
> Am 27.04.2025 um 16:43 schrieb Kenny McCormack:
>> In article <vulcf3$tsqb$1@raubtier-asyl.eternal-september.org>,
>> Bonita Montero  <Bonita.Montero@gmail.com> 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 <Windows.h>
>> 
>> Burp!
>> 
>>> #include <stdio.h>
>>>
>>> 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