Closed Bug 1239539 Opened 7 years ago Closed 6 years ago
Enable clang's -Wclass-varargs warnings
-Wclass-varargs catches objects passed by value to variadic functions. -Wclass-varargs was enabled for C++ in js/src in bug 1235185. This clang commit message is the closet thing to documentation about -Wclass-varargs: https://github.com/llvm-mirror/clang/commit/93fe566800e0a636442b4b61247c57b08de952c5 Here is a green Try build with -Wclass-varargs enabled: https://treeherder.mozilla.org/#/jobs?repo=try&revision=b1033040c96d
Attachment #8707708 - Flags: review?(mh+mozilla)
The most common variadic function in mozilla-central is MOZ_LOG(), which is technically a macro calling mozilla::detail::log_print(). Follow-up work could include annotating log_print() as a MOZ_FORMAT_PRINTF() function (like printf_stderr) so -Wformat warnings can type check MOZ_LOG()'s format string parameters.
Attachment #8707708 - Flags: review?(mh+mozilla) → review+
You need to log in before you can comment on or make changes to this bug.