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.)
This commit is contained in:
Antony Lee 2020-12-22 04:17:10 +01:00 committed by GitHub
parent 5bd766bf6c
commit 6b4297fd2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -232,7 +232,8 @@ def has_flag(compiler, flag):
with tmp_chdir(): with tmp_chdir():
fname = "flagcheck.cpp" fname = "flagcheck.cpp"
with open(fname, "w") as f: with open(fname, "w") as f:
f.write("int main (int argc, char **argv) { return 0; }") # Don't trigger -Wunused-parameter.
f.write("int main (int, char **) { return 0; }")
try: try:
compiler.compile([fname], extra_postargs=[flag]) compiler.compile([fname], extra_postargs=[flag])