Hacker News new | ask | show | jobs
by Tibbes 4609 days ago
Does anyone know the purpose of the self-assignment on page 3? (in the body of IsWriteCombined)

  DWORD error = GetLastError();
  error = error
1 comments

I often do that just to have a statement on which to place a breakpoint. It gets optimized out, but in debug builds it works fine. Putting a breakpoint on a line that just deals with the error code immediately after the error code will reliably display the error in the Auto Variables watch window in VStudio maligning it very convenient for rapid debugging.