In real time, if you code an infinite loop, then run time will be impacted and exits abnormally, but why doesn't a compiler show a error message at compile time if it is certainly a case?
Correct me if I am wrong, what I am thinking is, in a certain case, most of the stack/global/RAM memory will be full if loop goes infinite. Whatever you said correct for mail server, http server, ssh connection, operating system, etc, but how above mentioned case would be handled in compiler?
Chandrakant has a point: some loops are not intended to run forever, and can blow up the memory (or other inconveniences) if they do. We could imagine an extension to a given programming language where you could specify that a loop should end.
However, since loop termination is undecidable in the general case, a compiler would never be able to fully address this constraint. In my humble opinion, the best solution for now is to use the combination of a static analyzer and automatic and interactive provers, such as Atelier-B [1] or Frama-C [2] for instance.