tests: fix `-cstrict` self compilation on m0 with clang

pull/10394/head
Delyan Angelov 2021-06-07 16:24:42 +03:00
parent 4772146a7e
commit 9f6c4030f6
2 changed files with 17 additions and 8 deletions

View File

@ -57,13 +57,22 @@ fn (set ComparatorSet) satisfies(ver Version) bool {
} }
fn (c Comparator) satisfies(ver Version) bool { fn (c Comparator) satisfies(ver Version) bool {
return match c.op { if c.op == .gt {
.gt { ver.gt(c.ver) } return ver.gt(c.ver)
.lt { ver.lt(c.ver) }
.ge { ver.ge(c.ver) }
.le { ver.le(c.ver) }
.eq { ver.eq(c.ver) }
} }
if c.op == .lt {
return ver.lt(c.ver)
}
if c.op == .ge {
return ver.ge(c.ver)
}
if c.op == .le {
return ver.le(c.ver)
}
if c.op == .eq {
return ver.eq(c.ver)
}
return false
} }
fn parse_range(input string) ?Range { fn parse_range(input string) ?Range {

View File

@ -205,6 +205,8 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
'-Wno-trigraphs' /* see stackoverflow.com/a/8435413 */, '-Wno-trigraphs' /* see stackoverflow.com/a/8435413 */,
'-Wno-missing-braces' /* see stackoverflow.com/q/13746033 */, '-Wno-missing-braces' /* see stackoverflow.com/q/13746033 */,
// enable additional warnings: // enable additional warnings:
'-Wno-unknown-warning' /* if a C compiler does not understand a certain flag, it should just ignore it */,
'-Wno-unknown-warning-option' /* clang equivalent of the above */,
'-Wdate-time', '-Wdate-time',
'-Wduplicated-branches', '-Wduplicated-branches',
'-Wduplicated-cond', '-Wduplicated-cond',
@ -264,8 +266,6 @@ fn (mut v Builder) setup_ccompiler_options(ccompiler string) {
'-Wno-enum-conversion' /* used in vlib/sokol, where C enums in C structs are typed as V structs instead */, '-Wno-enum-conversion' /* used in vlib/sokol, where C enums in C structs are typed as V structs instead */,
'-Wno-sometimes-uninitialized' /* produced after exhaustive matches */, '-Wno-sometimes-uninitialized' /* produced after exhaustive matches */,
'-Wno-int-to-void-pointer-cast', '-Wno-int-to-void-pointer-cast',
'-Wno-unknown-warning' /* if a C compiler does not understand a certain flag, it should just ignore it */,
'-Wno-unknown-warning-option' /* clang equivalent of the above */,
] ]
} }
if ccoptions.is_cc_gcc { if ccoptions.is_cc_gcc {