Sujet : Re: integer divided by zero
De : gazelle (at) *nospam* shell.xmission.com (Kenny McCormack)
Groupes : comp.lang.cDate : 26. Apr 2025, 17:27:44
Autres entêtes
Organisation : The official candy of the new Millennium
Message-ID : <vuj1i0$2b72h$1@news.xmission.com>
References : 1 2 3 4
User-Agent : trn 4.0-test77 (Sep 1, 2010)
In article <
vuiu6e$2lqot$1@dont-email.me>,
Thiago Adams <
thiago.adams@gmail.com> wrote:
Em 4/25/2025 5:32 PM, Keith Thompson escreveu:
Thiago Adams <thiago.adams@gmail.com> writes:
[...]
Since 1/0 is not a constant, then if 1/0 were a constrain, the
programmer could use a variable instead.
>
static int zero = 0;
1/zero //ok
They could, but why? `1/zero` is not "ok"; it's undefined behavior.
>
It could me used in the sample given by Waldek
>
int signal_error(void) {
return 1/0;
}
>
int signal_error(void) {
int zero = 0;
return 1/zero;
}
Wouldn't it be easier just to use raise(3)?
-- So to cure the problem of arrogant incompetent rich people we should turnthe government over to an arrogant incompetent trust fund billionairewho knows nothing about government and who has never held a job in hisentire spoiled life?