Skip to content

Commit e24fa14

Browse files
author
Micah Scott @ MongoDB
authored
CDRIVER-4602 build fix for clang >= 3.1 and < 3.7 (#1775)
* Restrict use of "format-pedantic" warning (added in clang 3.7) to clang 4.0 and up
1 parent 0d1b5bc commit e24fa14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

build/cmake/MongoC-Warnings.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ function (mongoc_add_warning_options)
2828
set(cond/gcc-lt7 $<AND:${cond/gnu},$<VERSION_LESS:$<C_COMPILER_VERSION>,7>>)
2929
set(cond/gcc-lt8 $<AND:${cond/gnu},$<VERSION_LESS:$<C_COMPILER_VERSION>,8>>)
3030
set(cond/gcc-lt11 $<AND:${cond/gnu},$<VERSION_LESS:$<C_COMPILER_VERSION>,11>>)
31+
set(cond/clang-lt4 $<AND:${cond/clang},$<VERSION_LESS:$<C_COMPILER_VERSION>,4>>)
3132
set(cond/clang-lt10 $<AND:${cond/clang},$<VERSION_LESS:$<C_COMPILER_VERSION>,10>>)
3233
set(cond/clang-lt19 $<AND:${cond/clang},$<VERSION_LESS:$<C_COMPILER_VERSION>,19>>)
3334
# Process options:
@@ -96,7 +97,7 @@ mongoc_add_warning_options (
9697
# Clang does not include several flags in `-Wformat` or `-Wformat=2`.
9798
# For assurance, explicitly include those not listed by -Wformat or -Wformat=2.
9899
clang:-Werror=format-non-iso
99-
clang:-Werror=format-pedantic
100+
clang:not-clang-lt4:-Werror=format-pedantic
100101
clang:not-clang-lt19:-Werror=format-signedness
101102
clang:not-clang-lt10:-Werror=format-type-confusion
102103

0 commit comments

Comments
 (0)