Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Validating the halt deciding criteria with a totally concrete example --- Step(1)

5 views
Skip to first unread message

olcott

unread,
Nov 24, 2020, 6:06:13 PM11/24/20
to
Every C programmer that can pay attention (Some respondents seem to have
attention deficit disorder) will see that the following code very
obviously specifies infinite recursion:


int DebugTrace(u32 P, u32 I)
{
return ((int(*)(int))P)(I);
}


void H_Hat(u32 P)
{
u32 Aborted = DebugTrace(P, P);
if (Aborted)
HALT
else
HERE: goto HERE;
}


int main()
{
u32 P = (u32)H_Hat;
DebugTrace(P, P);
HALT;
}

--
Copyright 2020 Pete Olcott

"Great spirits have always encountered violent opposition from mediocre
minds." Einstein
0 new messages