Commit 3d9cb5e0 by Dimitry Andric

Work around -Werror problems when detecting qsort variants

If `ENABLE_WERROR` is on, the CMake configure tests for the `qsort_r`
and `qsort_s` variants may fail due to warnings about unused functions
or unused parameters. These warnings can be ignored, so disable them
specifically for running those tests.
parent 251408cf
......@@ -58,6 +58,13 @@ add_feature_info(futimens GIT_USE_FUTIMENS "futimens support")
# qsort
# for these tests, temporarily save CMAKE_C_FLAGS and disable warnings about
# unused functions and parameters, otherwise they will always fail if
# ENABLE_WERROR is on
set(SAVED_CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
disable_warnings(unused-function)
disable_warnings(unused-parameter)
# old-style FreeBSD qsort_r() has the 'context' parameter as the first argument
# of the comparison function:
check_prototype_definition(qsort_r
......@@ -82,6 +89,9 @@ check_prototype_definition(qsort_s
"void (qsort_s)(void *base, size_t num, size_t width, int (*compare )(void *, const void *, const void *), void *context)"
"" "stdlib.h" GIT_QSORT_S_MSC)
# restore CMAKE_C_FLAGS
set(CMAKE_C_FLAGS "${SAVED_CMAKE_C_FLAGS}")
# random / entropy data
check_function_exists(getentropy GIT_RAND_GETENTROPY)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment