title: How can I set a breakpoint on an empty statement in C++?
body: <p>Specifically, I want to write a macro that</p>
  
  <p>1) allows me to set a breakpoint<br>
  2) does nothing else<br>
  3) causes no compiler warnings  </p>
  
  <pre><code>#define NO_OP   ((void)0)
  
  void main()
  {
      bool b = true;
      if (b)
          NO_OP;  // I try to set a breakpoint here, but
  
  }               // it jumps to here (in Visual Studio 2010)
  </code></pre>
  
  <p>I also tried</p>
  
  <pre><code>#define NO_OP   (assert(1))             // doesn't work
  #define NO_OP   (sizeof(int))           // doesn't work
  #define NO_OP   __asm{}                 // doesn't work
  #define NO_OP   do {(void)0;} while(0)  // warning: conditional is constant
  </code></pre>
  
  <p>The only thing that works so far is the cringe-worthy</p>
  
  <pre><code>#define NO_OP   { int x = 0; x = x; }
  </code></pre>
  
  <p>There has to be a better way.</p>
  
  <p><strong>EDIT</strong><br>
  Thanks <strong>Blorgbeard</strong>, __asm{ nop } does indeed work. But I just realized that anything with braces is less than perfect (problematic?) because it leaves a useless semi-colon hanging there after it. (Later) I don't know squat about assembler but I tried removing the braces, and voila! There's the answer: __asm nop
  Thanks!</p>
  
  <p><strong>FOR THE CURIOUS</strong><br>
  Here's a slightly less absurd example:   </p>
  
  <pre><code>string token = GetNextToken();
  if (!Ignore(token))
  {
      // process token
      DoThis(token);
      DoThat(token);
  }
  </code></pre>
  
  <p>This code is complete -- as long as the program works correctly I don't care to know anything about ignored tokens. But at any given time (and without changing the code) I want to make sure that I'm not rejecting good tokens   </p>
  
  <pre><code>string token = GetNextToken();
  if (Ignore(token))
  {
      NO_OP; // when desired, set breakpoint here to monitor ignored tokens
  }
  else
  {
      // process token
      DoThis(token);
      DoThat(token);
  }
  </code></pre>