GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: avoid unused variable 'error' warning · nodejs/node@c40a827

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src
    • debug_utils.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/debug_utils.cc‎

Copy file name to clipboardExpand all lines: src/debug_utils.cc
+15-6Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext {
182182
return NameAndDisplacement(pSymbol->Name, dwDisplacement);
183183
} else {
184184
// SymFromAddr failed
185-
const DWORD error = GetLastError(); // "eat" the error anyway
186185
#ifdef DEBUG
186+
const DWORD error = GetLastError();
187187
fprintf(stderr, "SymFromAddr returned error : %lu\n", error);
188-
#endif
188+
#else
189+
// Consume the error anyway
190+
USE(GetLastError());
191+
#endif // DEBUG
189192
}
190193
// End MSDN code
191194

@@ -217,10 +220,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext {
217220
sym.line = line.LineNumber;
218221
} else {
219222
// SymGetLineFromAddr64 failed
220-
const DWORD error = GetLastError(); // "eat" the error anyway
221223
#ifdef DEBUG
224+
const DWORD error = GetLastError();
222225
fprintf(stderr, "SymGetLineFromAddr64 returned error : %lu\n", error);
223-
#endif
226+
#else
227+
// Consume the error anyway
228+
USE(GetLastError());
229+
#endif // DEBUG
224230
}
225231
// End MSDN code
226232

@@ -240,10 +246,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext {
240246
return szUndName;
241247
} else {
242248
// UnDecorateSymbolName failed
243-
const DWORD error = GetLastError(); // "eat" the error anyway
244249
#ifdef DEBUG
250+
const DWORD error = GetLastError();
245251
fprintf(stderr, "UnDecorateSymbolName returned error %lu\n", error);
246-
#endif
252+
#else
253+
// Consume the error anyway
254+
USE(GetLastError());
255+
#endif // DEBUG
247256
}
248257
return nullptr;
249258
}

0 commit comments

Comments
0 (0)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.