Artifactspublic-v0

curl

master
ply4 git calls36 ms293 KiB3 cachedprotocol v2
465 lines23 KiBRaw
1#***************************************************************************
2# _ _ ____ _
3# Project ___| | | | _ \| |
4# / __| | | | |_) | |
5# | (__| |_| | _ <| |___
6# \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9#
10# This software is licensed as described in the file COPYING, which
11# you should have received as part of this distribution. The terms
12# are also available at https://curl.se/docs/copyright.html.
14# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15# copies of the Software, and permit persons to whom the Software is
16# furnished to do so, under the terms of the COPYING file.
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
21# SPDX-License-Identifier: curl
23###########################################################################
24include(CheckCCompilerFlag)
26set(_picky "")
27set(_picky_nocheck "") # not to pass to feature checks
29if(CURL_WERROR)
30 if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
31 set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
32 elseif(MSVC)
33 list(APPEND _picky_nocheck "-WX")
34 else() # llvm/clang and gcc-style options
35 list(APPEND _picky_nocheck "-Werror")
36 endif()
38 if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND
39 NOT DOS AND # Watt-32 headers use the '#include_next' GCC extension
40 CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0) OR
41 CMAKE_C_COMPILER_ID MATCHES "Clang")
42 list(APPEND _picky_nocheck "-pedantic-errors")
43 endif()
44endif()
46if(APPLE AND
47 (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
48 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
49 list(APPEND _picky "-Werror=partial-availability") # clang 3.6 appleclang 6.1
50endif()
52if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
53 list(APPEND _picky "-Werror-implicit-function-declaration") # clang 1.0 gcc 2.95
54endif()
56if(MSVC)
57 list(APPEND _picky "-W4") # Use the highest warning level for Visual Studio.
58elseif(BORLAND)
59 list(APPEND _picky "-w-") # Disable warnings on Borland to avoid changing 3rd party code.
60endif()
62if(PICKY_COMPILER)
63 # Leave disabled for GCC <4.6, because they lack #pragma features to silence locally.
64 if((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.6) OR
65 CMAKE_C_COMPILER_ID MATCHES "Clang")
67 # https://clang.llvm.org/docs/DiagnosticsReference.html
68 # https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
70 # _picky_enable = Options we want to enable as-is.
71 # _picky_detect = Options we want to test first and enable if available.
73 # Prefer the -Wextra alias with clang.
74 if(CMAKE_C_COMPILER_ID MATCHES "Clang")
75 set(_picky_enable "-Wextra")
76 else()
77 set(_picky_enable "-W")
78 endif()
80 list(APPEND _picky_enable "-Wall")
82 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.2) OR
83 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2) OR
84 CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
85 list(APPEND _picky_enable "-Wpedantic") # clang 3.2 gcc 4.8 appleclang 4.2
86 else()
87 list(APPEND _picky_enable "-pedantic")
88 endif()
90 # ----------------------------------
91 # Add new options here, if in doubt:
92 # ----------------------------------
93 set(_picky_detect
94 )
96 # Notes: -Wno-* options should ideally be disabled at their precise cutoff versions,
97 # to suppress undesired warnings in case -Weverything is passed as a custom option.
99 # Assume these options always exist with both clang and gcc.
100 # Require clang 3.0 / gcc 2.95 or greater.
101 list(APPEND _picky_enable
102 -Wbad-function-cast # clang 2.7 gcc 2.95
103 -Wconversion # clang 2.7 gcc 2.95
104 -Wmissing-declarations # clang 1.0 gcc 2.7
105 -Wmissing-prototypes # clang 1.0 gcc 1.0
106 -Wnested-externs # clang 1.0 gcc 2.7
107 -Wno-long-long # clang 1.0 gcc 2.95
108 -Wno-multichar # clang 1.0 gcc 2.95
109 -Wpointer-arith # clang 1.0 gcc 1.4
110 -Wshadow # clang 1.0 gcc 2.95
111 -Wsign-compare # clang 1.0 gcc 2.95
112 -Wundef # clang 1.0 gcc 2.95
113 -Wunused # clang 1.1 gcc 2.95
114 -Wwrite-strings # clang 1.0 gcc 1.4
115 )
117 # Always enable with clang, version dependent with gcc
118 set(_picky_common_old
119 -Waddress # clang 2.7 gcc 4.3
120 -Wattributes # clang 2.7 gcc 4.1
121 -Wcast-align # clang 1.0 gcc 4.2
122 -Wcast-qual # clang 2.7 gcc 3.4.6
123 -Wdeclaration-after-statement # clang 1.0 gcc 3.4
124 -Wdiv-by-zero # clang 2.7 gcc 4.1
125 -Wempty-body # clang 2.7 gcc 4.3
126 -Wendif-labels # clang 1.0 gcc 3.3
127 -Wfloat-equal # clang 1.0 gcc 2.96 (3.0)
128 -Wformat-security # clang 2.7 gcc 4.1
129 -Wignored-qualifiers # clang 2.8 gcc 4.3
130 -Wmissing-field-initializers # clang 2.7 gcc 4.1
131 -Wmissing-noreturn # clang 2.7 gcc 4.1
132 -Wno-padded # clang 2.9 gcc 4.1 # Not used: We cannot change public structs
133 -Wno-sign-conversion # clang 2.9 gcc 4.3
134 -Wno-switch-default # clang 2.7 gcc 4.1 # Not used: Annoying to fix or silence
135 -Wno-switch-enum # clang 2.7 gcc 4.1 # Not used: It basically disallows default case
136 -Wno-system-headers # clang 1.0 gcc 3.0
137 -Wold-style-definition # clang 2.7 gcc 3.4
138 -Wredundant-decls # clang 2.7 gcc 4.1
139 -Wstrict-prototypes # clang 1.0 gcc 3.3
140 -Wtype-limits # clang 2.7 gcc 4.3
141 -Wunreachable-code # clang 2.7 gcc 4.1
142 # -Wunused-macros # clang 2.7 gcc 4.1 # Not practical
143 # -Wno-error=unused-macros # clang 2.7 gcc 4.1
144 -Wunused-parameter # clang 2.7 gcc 4.1
145 -Wvla # clang 2.8 gcc 4.3
146 )
148 if(CMAKE_C_COMPILER_ID MATCHES "Clang")
149 list(APPEND _picky_enable
150 ${_picky_common_old}
151 -Wconditional-uninitialized # clang 3.0
152 -Wno-used-but-marked-unused # clang 2.9 # for typecheck-gcc.h with clang 14+, dependency headers
153 -Wshift-sign-overflow # clang 2.9
154 -Wshorten-64-to-32 # clang 1.0
155 -Wformat=2 # clang 2.7 gcc 4.8
156 )
157 if(NOT MSVC)
158 list(APPEND _picky_enable
159 -Wlanguage-extension-token # clang 3.0
160 )
161 endif()
162 # Enable based on compiler version
163 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.1)
164 list(APPEND _picky_enable
165 -Wno-covered-switch-default # clang 3.1 appleclang 3.1 # Annoying to fix or silence
166 -Wno-disabled-macro-expansion # clang 3.1 appleclang 3.1 # for std headers, and curl/curl.h (rare combos)
167 )
168 if(MSVC)
169 list(APPEND _picky_enable
170 -Wno-format-non-iso # clang 3.1 appleclang 3.1 # 'q' length modifier is not supported by ISO C
171 )
172 else()
173 list(APPEND _picky_enable
174 -Wformat-non-iso # clang 3.1 appleclang 3.1
175 )
176 endif()
177 endif()
178 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.3) OR
179 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0))
180 list(APPEND _picky_enable
181 -Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
182 -Wmissing-variable-declarations # clang 3.2 appleclang 4.2
183 -Wno-documentation-unknown-command # clang 3.3 appleclang 5.0
184 -Wsometimes-uninitialized # clang 3.2 appleclang 4.2
185 )
186 endif()
187 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.6) OR
188 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.1))
189 list(APPEND _picky_enable
190 -Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
191 -Wheader-guard # clang 3.4 appleclang 5.1
192 -Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
193 # -Wunreachable-code-break # clang 3.5 appleclang 6.0 # Not used: Silent in "unity" builds
194 -Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
195 )
196 endif()
197 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
198 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
199 list(APPEND _picky_enable
200 -Wcomma # clang 3.9 appleclang 8.1
201 )
202 if(MSVC)
203 list(APPEND _picky_enable
204 -Wno-nonportable-system-include-path # clang 3.9 appleclang 8.1 # No truly portable solution to this
205 )
206 endif()
207 endif()
208 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0) OR
209 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 11))
210 list(APPEND _picky_enable
211 -Wassign-enum # clang 7.0 appleclang 11.0
212 -Wextra-semi-stmt # clang 7.0 appleclang 11.0
213 )
214 endif()
215 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) OR
216 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 12))
217 list(APPEND _picky_enable
218 -Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0 # We do silencing for clang 10.0+ only
219 -Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
220 )
221 endif()
222 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0) OR
223 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.1))
224 list(APPEND _picky_enable
225 -Wcast-function-type # clang 13.0 appleclang 13.1
226 -Wreserved-identifier # clang 13.0 appleclang 13.1 # Keep it before -Wno-reserved-macro-identifier
227 -Wno-reserved-macro-identifier # clang 13.0 appleclang 13.1 # External macros have to be set sometimes
228 )
229 endif()
230 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0) OR
231 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 14.0.3))
232 if(CMAKE_GENERATOR STREQUAL "FASTBuild")
233 list(APPEND _picky_enable
234 -Wno-gnu-line-marker # clang 15.0 appleclang 14.0.3
235 )
236 endif()
237 endif()
238 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
239 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0))
240 list(APPEND _picky_enable
241 -Wno-unsafe-buffer-usage # clang 16.0 appleclang 15.0
242 )
243 endif()
244 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0) OR
245 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0))
246 list(APPEND _picky_enable
247 -Wcast-function-type-strict # clang 16.0 appleclang 16.0
248 )
249 endif()
250 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.1) OR
251 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 17.0))
252 list(APPEND _picky_enable
253 -Wformat-signedness # clang 19.1 gcc 5.1 appleclang 17.0 # In clang-cl enums are signed ints by default
254 )
255 endif()
256 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 21.1) OR
257 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 26.4))
258 list(APPEND _picky_enable
259 -Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
260 -Wc++-hidden-decl # clang 21.1 appleclang 26.4
261 -Wimplicit-int-enum-cast # clang 21.1
262 -Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
263 -Wno-implicit-void-ptr-cast # clang 21.1 appleclang 26.4
264 -Wtentative-definition-compat # clang 21.1 appleclang 26.4
265 )
266 if(WIN32)
267 list(APPEND _picky_enable
268 -Wno-c++-keyword # clang 21.1 appleclang 26.4 # `wchar_t` triggers it on Windows
269 )
270 else()
271 list(APPEND _picky_enable
272 -Wc++-keyword # clang 21.1 appleclang 26.4
273 )
274 endif()
275 endif()
276 else() # gcc
277 # Enable based on compiler version
278 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3)
279 list(APPEND _picky_enable
280 ${_picky_common_old}
281 -Wclobbered # gcc 4.3
282 -Wmissing-parameter-type # gcc 4.3
283 -Wold-style-declaration # gcc 4.3
284 -Wpragmas # clang 3.5 gcc 4.1 appleclang 6.0
285 -Wstrict-aliasing=3 # gcc 4.0
286 -ftree-vrp # gcc 4.3 (required for -Warray-bounds, included in -Wall)
287 )
288 endif()
289 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.5)
290 list(APPEND _picky_enable
291 -Wjump-misses-init # clang 21.1 gcc 4.5 appleclang 26.4
292 )
293 if(MINGW)
294 list(APPEND _picky_enable
295 -Wno-pedantic-ms-format # gcc 4.5 (MinGW-only)
296 )
297 endif()
298 endif()
299 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.8)
300 list(APPEND _picky_enable
301 -Wdouble-promotion # clang 3.6 gcc 4.6 appleclang 6.1
302 -Wformat=2 # clang 2.7 gcc 4.8
303 -Wlogical-op # gcc 4.4
304 -Wtrampolines # gcc 4.6
305 )
306 endif()
307 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.0)
308 list(APPEND _picky_enable
309 -Warray-bounds=2 # clang 2.9 gcc 5.0 (clang default: -Warray-bounds)
310 -Wformat-signedness # clang 19.1 gcc 5.1 appleclang 17.0
311 )
312 endif()
313 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 6.0)
314 list(APPEND _picky_enable
315 -Wduplicated-cond # gcc 6.0
316 -Wnull-dereference # clang 2.9 gcc 6.0 (clang default)
317 -fdelete-null-pointer-checks
318 -Wshift-negative-value # clang 3.7 gcc 6.0 (clang default)
319 -Wshift-overflow=2 # clang 2.9 gcc 6.0 (clang default: -Wshift-overflow)
320 -Wunused-const-variable # clang 3.4 gcc 6.0 appleclang 5.1
321 )
322 endif()
323 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 7.0)
324 list(APPEND _picky_enable
325 -Walloc-zero # gcc 7.0
326 -Wduplicated-branches # gcc 7.0
327 -Wformat-truncation=2 # gcc 7.0
328 -Wimplicit-fallthrough # clang 4.0 gcc 7.0 appleclang 9.0
329 -Wrestrict # gcc 7.0
330 )
331 endif()
332 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
333 list(APPEND _picky_enable
334 -Warith-conversion # gcc 10.0
335 -Wenum-conversion # clang 3.2 gcc 10.0 appleclang 4.2 g++ 11.0
336 )
337 endif()
338 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
339 list(APPEND _picky_enable
340 -Warray-compare # clang 20.1 gcc 12.0 appleclang 26.4
341 -Wenum-int-mismatch # gcc 13.0
342 -Wxor-used-as-pow # clang 10.0 gcc 13.0 appleclang 12.0
343 )
344 endif()
345 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 15.0)
346 list(APPEND _picky_enable
347 -Wleading-whitespace=spaces # gcc 15.0
348 -Wtrailing-whitespace=any # gcc 15.0
349 -Wunterminated-string-initialization # gcc 15.0
350 )
351 endif()
352 endif()
354 # Assemble list of flags
356 set(_picky_skipped "")
357 foreach(_ccopt IN LISTS _picky_enable)
358 string(REGEX MATCH "-W([a-z0-9+-]+)" _ccmatch "${_ccopt}")
359 string(REPLACE "+" "\\+" _cmake_match_1 "${CMAKE_MATCH_1}") # escape '+' to make it a valid regex
360 if(_ccmatch AND "${CMAKE_C_FLAGS} " MATCHES "-Wno-${_cmake_match_1} " AND
361 NOT _ccopt STREQUAL "-Wall" AND
362 NOT _ccopt MATCHES "^-Wno-")
363 string(APPEND _picky_skipped " ${_ccopt}")
364 else()
365 list(APPEND _picky "${_ccopt}")
366 endif()
367 endforeach()
368 if(_picky_skipped)
369 message(STATUS "Picky compiler options skipped due to CMAKE_C_FLAGS override:${_picky_skipped}")
370 endif()
372 foreach(_ccopt IN LISTS _picky_detect)
373 # Use a unique variable name 1. for meaningful log output 2. to have a fresh, undefined variable for each detection
374 string(MAKE_C_IDENTIFIER "OPT${_ccopt}" _optvarname)
375 # GCC only warns about unknown -Wno- options if there are also other diagnostic messages,
376 # so test for the positive form instead
377 string(REPLACE "-Wno-" "-W" _ccopt_on "${_ccopt}")
378 check_c_compiler_flag(${_ccopt_on} ${_optvarname})
379 if(${_optvarname})
380 list(APPEND _picky "${_ccopt}")
381 endif()
382 endforeach()
384 if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
385 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.0 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.7)
386 list(APPEND _picky "-Wno-missing-field-initializers") # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=36750
387 endif()
388 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.3 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 4.8)
389 list(APPEND _picky "-Wno-type-limits") # Avoid false positives
390 endif()
391 if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 5.1 AND CMAKE_C_COMPILER_VERSION VERSION_LESS 5.5)
392 list(APPEND _picky "-Wno-conversion") # Avoid false positives
393 endif()
394 endif()
395 elseif(MSVC AND MSVC_VERSION LESS_EQUAL 1951) # Enable for tested versions only
396 list(APPEND _picky "-Wall")
397 list(APPEND _picky "-wd4061") # enumerator 'A' in switch of enum 'B' is not explicitly handled by a case label
398 list(APPEND _picky "-wd4191") # 'type cast': unsafe conversion from 'FARPROC' to 'void (__cdecl *)(void)'
399 list(APPEND _picky "-wd4255") # no function prototype given: converting '()' to '(void)' (in winuser.h)
400 list(APPEND _picky "-wd4464") # relative include path contains '..'
401 list(APPEND _picky "-wd4548") # expression before comma has no effect; expected expression with side-effect (in FD_SET())
402 list(APPEND _picky "-wd4574") # 'M' is defined to be '0': did you mean to use '#if M'? (in ws2tcpip.h)
403 list(APPEND _picky "-wd4668") # 'M' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif' (in winbase.h)
404 list(APPEND _picky "-wd4710") # 'fprintf'/'printf'/'sscanf': function not inlined (in tests, with VS2022+ Release)
405 list(APPEND _picky "-wd4711") # function 'A' selected for automatic inline expansion
406 # volatile access of '<expression>' is subject to /volatile:<iso|ms> setting;
407 # consider using __iso_volatile_load/store intrinsic functions (ARM64)
408 list(APPEND _picky "-wd4746")
409 list(APPEND _picky "-wd4820") # 'A': 'N' bytes padding added after data member 'B'
410 if(MSVC_VERSION GREATER_EQUAL 1900)
411 list(APPEND _picky "-wd5045") # Compiler inserts Spectre mitigation for memory load if /Qspectre switch specified
412 endif()
413 endif()
414endif()
416# clang-cl
417if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND MSVC)
418 list(APPEND _picky "-Wno-language-extension-token") # Allow __int64
420 foreach(_wlist IN ITEMS _picky_nocheck _picky)
421 set(_picky_tmp "")
422 foreach(_ccopt IN LISTS "${_wlist}")
423 # Prefix -Wall, otherwise clang-cl interprets it as an MSVC option and translates it to -Weverything
424 if(_ccopt MATCHES "^-W" AND NOT _ccopt STREQUAL "-Wall")
425 list(APPEND _picky_tmp ${_ccopt})
426 else()
427 list(APPEND _picky_tmp "-clang:${_ccopt}")
428 endif()
429 endforeach()
430 set("${_wlist}" ${_picky_tmp}) # cmake-lint: disable=C0103
431 endforeach()
432endif()
434if(CMAKE_C_STANDARD STREQUAL 90)
435 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.0) OR
436 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 4.2))
437 list(APPEND _picky "-Wno-c99-extensions") # Avoid: warning: '_Bool' is a C99 extension
438 endif()
439 if((CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 3.9) OR
440 (CMAKE_C_COMPILER_ID STREQUAL "AppleClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 8.1))
441 list(APPEND _picky "-Wno-comma") # Silly
442 endif()
443endif()
445if(DOS AND CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)
446 list(APPEND _picky "-Wno-arith-conversion") # Avoid warnings in DJGPP's built-in FD_SET() macro
447endif()
449if(_picky_nocheck OR _picky)
450 set(_picky_tmp "${_picky_nocheck}" "${_picky}")
451 string(REPLACE ";" " " _picky_tmp "${_picky_tmp}")
452 string(STRIP "${_picky_tmp}" _picky_tmp)
453 message(STATUS "Picky compiler options: ${_picky_tmp}")
454 if(_CURL_SAVE_PICKY_OPTIONS)
455 file(WRITE "${PROJECT_BINARY_DIR}/picky-options.txt" "${_picky_tmp}")
456 endif()
457 set_property(DIRECTORY APPEND PROPERTY COMPILE_OPTIONS "${_picky_nocheck}" "${_picky}")
459 # Apply to all feature checks
460 string(REPLACE ";" " " _picky_tmp "${_picky}")
461 string(APPEND CMAKE_REQUIRED_FLAGS " ${_picky_tmp}")
463 unset(_picky)
464 unset(_picky_tmp)
465endif()
Diagnostics4 git calls · 36 ms
CallStatusSizeTime036 ms
discover200152 B3 ms
git.upload-pack discover
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=3
git.response.bytes=152
git.server.agent=gitty/1.0
git.server.object_format=sha1
git.server.caps=agent ls-refs fetch object-format
git.server.fetch=shallow filter sideband-all
git.protocol.version=2
git.pkt.frames=8
git.pkt.data=6
git.pkt.flush=2
git.pkt.delim=0
git.pkt.bytes=152
git.pkt.payload.max=34
ls-refs200149 B · hit3 ms
git.upload-pack ls-refs
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=ls-refs
git.upstream.dur_ms=3
git.response.bytes=149
git.response.cache=HIT
git.response.duration_ms=3
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=149
git.pkt.payload.max=78
git.ls_refs.count=2
git.ls_refs.head=refs/heads/master
fetchblob:none · deepen 10200287 KiB · hit3 ms
git.upload-pack fetch
http.response.status_code=200
git.upstream.cf_ray=-
git.upstream.phase=fetch
git.upstream.dur_ms=30
git.response.bytes=293470
git.response.cache=HIT
git.response.duration_ms=3
git.fetch.filter=blob:none
git.fetch.filter.requested=tree:0
git.fetch.filter.fallback=blob:none
git.fetch.filter.learned=false
git.fetch.wants=31c911efe5652725e930f4d2e60c9060e5f6646d
git.fetch.haves.count=0
git.fetch.deepen=10
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=10
git.pkt.data=8
git.pkt.flush=1
git.pkt.delim=1
git.pkt.bytes=293470
git.pkt.payload.max=65516
git.sideband.band1.bytes=293354
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0
git.pack.objects=87
git.pack.bytes=293354
git.pack.ofs_delta=0
git.pack.ref_delta=1
git.pack.chain.max=1
git.pack.trailer=6a646bcda6740bab42e321b51998b52ea15146c0
git.pack.full=86
Open pack map
fetch2006.1 KiB · hit30 ms
git.upload-pack fetch
http.response.status_code=200
git.response.bytes=6212
git.response.cache=HIT
git.response.duration_ms=30
git.fetch.wants=e412cd351dec297efd7287ec90a36870ec28bad1
git.fetch.haves.count=0
git.fetch.deepen=0
git.fetch.thin_pack=false
git.fetch.ofs_delta=true
git.protocol.version=2
git.pkt.frames=3
git.pkt.data=2
git.pkt.flush=1
git.pkt.delim=0
git.pkt.bytes=6212
git.pkt.payload.max=6191
git.sideband.band1.bytes=6190
git.sideband.band2.bytes=0
git.sideband.band3.bytes=0

Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.

Remote
https://5ad2236b39de4c8bd8f6270ea63f3ea9.artifacts.cloudflare.net/git/public-v0/curl.git
Ref
refs/heads/master
Commit
31c911efe5652725e930f4d2e60c9060e5f6646d
cf-ray
a5e30b9f8d0aee28
Request
25f68dd9…
Protocol
v2 · sha1
Agent
gitty/1.0
Filter
advertised
Fetch
shallow filter sideband-all
Capabilities
agent ls-refs fetch object-format