title: Endless loop in C/C++
body: <p>There are several possibilities to do an endless loop, here are a few I would choose:</p>
  
  <ul>
  <li><code>for(;;) {}</code></li>
  <li><code>while(1) {}</code> / <code>while(true) {}</code></li>
  <li><code>do {} while(1)</code> / <code>do {} while(true)</code></li>
  </ul>
  
  <p>Is there a certain form which one should choose? And do modern compilers make a difference between the middle and the last statement or does it realize that it is an endless loop and skips the checking part entirely?</p>
  
  <p>Edit: as it has been mentioned I forgot <code>goto</code>, but this was done out of the reason that I don't like it as a command at all.</p>
  
  <p>Edit2: I made some grep on the latest versions taken from kernel.org. I does seems as nothing much changed over time (within the Kernel at least)
  <a href="https://i.stack.imgur.com/GBCZI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/GBCZI.png" alt="enter image description here"></a></p>