Skip to content

Commit 6b4297f

Browse files
authored
fix: don't trigger -Wunused-parameter in flagcheck.cpp. (#2735)
... by leaving the unused parameters anonymous. (This can be checked e.g. by compiling python_example with -Wall -Wextra.)
1 parent 5bd766b commit 6b4297f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pybind11/setup_helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ def has_flag(compiler, flag):
232232
with tmp_chdir():
233233
fname = "flagcheck.cpp"
234234
with open(fname, "w") as f:
235-
f.write("int main (int argc, char **argv) { return 0; }")
235+
# Don't trigger -Wunused-parameter.
236+
f.write("int main (int, char **) { return 0; }")
236237

237238
try:
238239
compiler.compile([fname], extra_postargs=[flag])

0 commit comments

Comments
 (0)