Skip to content

Commit bb4a44d

Browse files
authored
Silence warnings about -Wno-deprecated-non-prototype (#989)
Builds were producing a great number of warnings like this: ``` cc1plus: warning: command-line option '-Wno-deprecated-non-prototype' is valid for C/ObjC but not for C++ ``` These warnings came from a build option in the `.bazelrc` file written by `configure.sh`, specifically the application of `-Wno-deprecated-non-prototype` to C++ files in external dependencies even though the flag is only valid for C. This PR changes the Bazel build `per_file_copt` and `host_per_file_copt` regexes for `-Wno-deprecated-non-prototype` from `external/.*` to `external/.*[.]c$` to target only C source files.
1 parent ce3570d commit bb4a44d

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

configure.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,13 +233,15 @@ if ! is_windows; then
233233
write_bazelrc "build --linkopt=-Wl,-rpath,${LIBDIR}"
234234
fi
235235

236+
write_bazelrc ""
237+
236238
# The following supressions are for warnings coming from external dependencies.
237239
# They're most likely inconsequential or false positives. Since we can't fix
238-
# them, we suppress the warnings to reduce noise during builds.
240+
# them, we suppress the warnings to reduce noise. Note: single quotes are needed
241+
# for the first two so that the $ anchors are preserved in the .bazelrc file.
239242

240-
write_bazelrc ""
241-
write_bazelrc "build --per_file_copt=external/.*@-Wno-deprecated-non-prototype"
242-
write_bazelrc "build --host_per_file_copt=external/.*@-Wno-deprecated-non-prototype"
243+
write_bazelrc 'build --per_file_copt=external/.*[.]c$@-Wno-deprecated-non-prototype'
244+
write_bazelrc 'build --host_per_file_copt=external/.*[.]c$@-Wno-deprecated-non-prototype'
243245
write_bazelrc "build --per_file_copt=external/com_google_protobuf/.*@-Wno-unused-function"
244246
write_bazelrc "build --host_per_file_copt=external/com_google_protobuf/.*@-Wno-unused-function"
245247
write_bazelrc "build --per_file_copt=external/eigen/.*@-Wno-maybe-uninitialized"

0 commit comments

Comments
 (0)