On 2023-12-17 at 14:27, Bonita Montero wrote:
> int main( int argc, char ** )
> {
> switch( argc )
> {
> for( ; ; )
> {
> case 1:;
> }
> }
> }
Why do you consider it "Unbelievable that that works"? Of course, you
first have to specify what you mean by "works". If argc is zero (which
is permitted), the program does nothing and exits immediately with a
successful exit status. If argc is non-zero, it enters an infinite loop
that does nothing - an implementation is permitted to implement such a
loop as if it did in fact terminate with a successful exit status.
Either way, nothing observable happens other than the exit status, which
means that an implementation is free to implement this as the equivalent
of "int main(void) {}".
Is that what's intended? If so, it does works.
Is it the unconventional location of the case label that you don't
understand? That location is permitted, and has well-defined
behavior.understand? That location is permitted, and has well-defined
behavior.
translate.google.com (apologies for any mistranslation - my own German
is not any better than Google's):
Warum halten Sie es als "unglaublich, dass das funktioniert"? Natürlich
müssen Sie zuerst angeben, was Sie mit "Werken" meinen. Wenn argc Null
ist (was zulässig ist), tut das Programm nichts und verlässt sofort
einen erfolgreichen Ausstiegsstatus. Wenn argc ungleich Null ist, tritt
eine unendliche Schleife ein, die nichts tut - eine Implementierung darf
eine solche Schleife implementieren, als ob sie tatsächlich einen
erfolgreichen Ausstiegsstatus beendet hätte. In beiden Fällen passiert
nichts anderes als den Exit -Status, was bedeutet, dass eine
Implementierung frei ist, dies als das Äquivalent von "int main (void)
{}" zu implementieren.
Ist es das, was beabsichtigt ist? Wenn ja, funktioniert es.
Ist es der unkonventionelle Ort des Falletiketts, den Sie nicht
verstehen? Dieser Ort ist erlaubt und hat ein gut definiertes Verhalten.
One aspect of the translation that I did fiddle with: Google translated
"Unglaublich, dass das funktioniert" as "Unbelievable that this works",
but during the reverse translation it used "dies" rather than "das". If
I used "Unbelievable that that works", it reproduced the original
Subject line.
As a native English speaker, "that this works" feels more appropriate to
me. Is "das" more appropriate than "dies" in German?