Sujet : Re: Every sufficiently competent C programmer knows
De : Keith.S.Thompson+u (at) *nospam* gmail.com (Keith Thompson)
Groupes : comp.theoryDate : 16. Mar 2025, 20:26:13
Autres entêtes
Organisation : None to speak of
Message-ID : <877c4owze2.fsf@nosuchdomain.example.com>
References : 1 2 3 4 5 6 7
User-Agent : Gnus/5.13 (Gnus v5.13)
Richard Heathfield <
rjh@cpax.org.uk> writes:
On 16/03/2025 10:31, Mikko wrote:
False. You didn't say that HHH is a C function. In particular, the
code
shown above does not say so.
>
It scarcely qualifies as C.
>
For example, it begins by a goto this code:
>
__asm__("lea eax, DATA1");
__asm__("mov Aborted, eax");
__asm__("lea eax, DATA2");
__asm__("mov execution_trace, eax");
__asm__("mov eax, END_OF_CODE");
__asm__("mov End_Of_Code, eax");
>
which any C compiler is free to reject.
>
C99 introduced the asm keyword, but that's spelled asm, not __asm__,
and of course it's not a magic wand, so it can't make an inherently
unportable program work on every platform supported by C
compilers. C/370, for example, would have a fit.
No, C99 didn't introduce the asm keyword. Both C90 and C99 (and all
later editions) document the "asm" keyword as a common extension,
but it's not in the list of keywords. K&R1 (1978) mentions that
some implementations reserve "fortran" and "asm". A conforming C
compiler must accept "asm" as an ordinary identifier.
I don't think Olcott intends HHH to be fully portable C (assuming
he knows what that means). In any case, his claims about "Every
sufficiently competent C programmer" are ludicrous.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */