Visitar URL original
gh-76961: Possible fix for buildbot failures in test_pep3118 by mdickinson · Pull Request #101587 · python/cpython · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Silence Wunused-variable via the time-honoured solution of casting to…
… void
  • Loading branch information
mdickinson committed Feb 5, 2023
commit f273e74c3bf2e74e2ddaf4de4149d02ec851ef9b
2 changes: 1 addition & 1 deletion Modules/_ctypes/stgdict.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ _ctypes_alloc_format_padding(const char *prefix, Py_ssize_t padding)
return _ctypes_alloc_format_string(prefix, "x");
}

int ret = PyOS_snprintf(buf, sizeof(buf), "%zdx", padding);
int ret = PyOS_snprintf(buf, sizeof(buf), "%zdx", padding); (void)ret;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, the (void)ret; trick comes from the LLVM Coding Standard: https://llvm.org/docs/CodingStandards.html#assert-liberally

assert(0 <= ret && ret < (Py_ssize_t)sizeof(buf));
return _ctypes_alloc_format_string(prefix, buf);
}
Expand Down