0

what if we run infinite loop in smartphonewhi ?

infinite loop throw while loop ?

20th Aug 2021, 3:15 AM
Shiwani Samant✅
Shiwani Samant✅ - avatar
2 Réponses
0
You have not mentioned language ... Also beware: in C, the language for the generated source, while an empty loop with constant controlling expression, such as `while(1){}`, is formally OK, it may cause issues with some compilers. There was such an issue with clang, (https://bugs.llvm.org/show_bug.cgi?id=965). And in C++ /any/ inifnite loop with do-nothing body, such as the generated code's `while(1){}`, is effectively Undefined Behavior, because a C++ compiler can /assume/ that any thread eventually makes some observable progress.
20th Aug 2021, 3:39 AM
A S Raghuvanshi
A S Raghuvanshi - avatar