Commit Graph

14048 Commits

Author SHA1 Message Date
Tal Regev
bb9c15e97a
vtls: fix MSVC 'cast truncates constant value' warning
Fixes:
```
curl\lib\vtls\cipher_suite.c(193,3): error C2220: the following warning is treated as an error
curl\lib\vtls\cipher_suite.c(193,3): warning C4310: cast truncates constant value
```

Closes #14341
2024-08-03 09:22:25 +02:00
Stefan Eissing
39b9ccea8d
x509asn1: raise size limit for x509 certification information
Raise the limit for certification information from 10 thousand to 100
thousand bytes. Certificates can be larger than 10k.

Change the infof() debug output to add '...' at the end when the max
limit it can handle is exceeded.

Reported-by: Sergio Durigan Junior
Fixes #14352
Closes #14354
2024-08-02 23:20:57 +02:00
Stefan Eissing
ba44ac62e3
progress: ratelimit/progress tweaks
- multi.c: when ratelimiting a transfer stops (MSTATE_RATELIMITING ->
  MSTATE_PERFORMING), run the MSTATE_PERFORMING state right away

- urldata.h: factor out upload and download progress counters into a
  struct, use that for passing these to progress update functions

- progress.c/getinfo.c: change names of moved progress counters

- progress.c: use new structs and a helper struct to factor repeated
  calculation into static helpers

Closes #14335
2024-08-02 11:17:44 +02:00
Stefan Eissing
eb0a366b70
http2: improve rate limiting of downloads
Set the initial stream window size to 64KB and increase that to the 10MB
we used to start with on the first server reply, unless a rate limit is
in effect.

Continously monitory changes to the transfers rate limit and adjust the
stream window size accordingly. `max_recv_speed` is a transfer propert
that can be changed during processing by a callback.

Closes #14326
2024-08-02 08:45:01 +02:00
Daniel Stenberg
9bfc7f9234
escape: allow curl_easy_escape to generate 3*input length output
Instead of capping it to the 3 * CURL_MAX_INPUT_LENGTH. To allow users
to URL encode larger chunks of data.

Closes #14339
2024-08-01 23:03:21 +02:00
Stefan Eissing
02e0151a3a
lib: convert some debugf()s into traces
Use CURL_TRC_CF() for some useful tracing information instead of
DEBUGF().

Closes #14322
2024-07-31 23:14:24 +02:00
Joe Birr-Pixton
dd95a49d49
rustls: make all tests pass
- supports IP addresses in certs since 0.21
- Remove workaround, and re-enable tests

Closes #14317
2024-07-31 10:44:10 +02:00
Stefan Eissing
27959ecce7
x509asn1: unittests and fixes for gtime2str
Fix issues in GTime2str() and add unit test cases to verify correct
behaviour.

Follow-up to 3c914bc680

Closes #14316
2024-07-30 23:08:59 +02:00
Tal Regev
98da147b18
vtls: avoid forward declaration in MultiSSL builds
The MSVC compiler cannot have forward declaration with const and static
variable, causing this error:
```
curl\lib\vtls\vtls.c(417,44): warning C4132: 'Curl_ssl_multi': const object should be initialized
```

Ref: #14276
Closes #14305
2024-07-30 22:11:20 +02:00
Viktor Szakats
8153b8e580
tidy-up: URL updates (one more)
Follow-up to 767d5811b5 #14318
2024-07-30 21:36:39 +02:00
Viktor Szakats
767d5811b5
tidy-up: URL updates
Closes #14318
2024-07-30 21:27:12 +02:00
Alex Snast
f87a958e9e
wolfssl: avoid calling get_cached_x509_store if store is uncachable
There's no need for get_cached_x509_store call if the return value won't
be used for caching anyway.

Closes #14306
2024-07-30 13:02:17 +02:00
Daniel Stenberg
3c914bc680
x509asn1: clean up GTime2str
Co-authored-by: Stefan Eissing
Reported-by: Dov Murik

Closes #14307
2024-07-30 11:22:36 +02:00
Viktor Szakats
5f6b9244ce
macos: fix Apple SDK bug workaround for non-macOS targets
Turns out that MAC != OSX, despite what these names otherwise mean and
what's suggested by source code comments. "MAC" in fact means Darwin
(aka Apple), not macOS. "OSX" means macOS.

GitHub bumped the macos-14 runner default to Xcode 15.4, hitting the
llvm@15 incompatibility bug by default. Meaning the previous workaround
for the SDK bug is necessary.

This patch extend the workaround to not apply to mobile OS variants.

Follow-up to ff784af461 #14159
Reported-by: Sergey
Confirmed-by: Marcel Raad
Fixes #14269
Closes #14275
2024-07-29 20:41:39 +02:00
Stefan Eissing
0f2876b2c3
wolfssl: CA store share fix
When sharing the x509 store in wolfSSL, always use an explicitly
constructed one, as the SSLCTX might have "only" an internal one which
is not obeying reference count lifetimes.

Fixes #14278
Reported-by: Alex Snast
Closes #14279
2024-07-29 19:54:08 +02:00
Stefan Eissing
17e6f06ea3
connect: fix connection shutdown for event based processing
connections being shutdown would register sockets for events, but then
never remove these sockets again. Nor would the shutdown effectively
been performed.

- If a socket event involves a transfer, check if that is the
  connection cache internal handle and run its multi_perform()
  instead (the internal handle is used for all shutdowns).
- When a timer triggers for a transfer, check also if it is
  about the connection cache internal handle.
- During processing shutdowns in the connection cache, assess
  the shutdown timeouts. Register a Curl_expire() of the lowest
  value for the cache's internal handle.

Reported-by: Gordon Parke
Fixes #14280
Closes #14296
2024-07-29 14:53:43 +02:00
Patrick Monnerat
ad8c9a5807
os400: workaround an IBM ASCII run-time library bug
IBM-provided ASCII function puts() does not output an expected trailing
newline: emulate the correct behavior using other functions.

Closes #14281
2024-07-27 00:17:13 +02:00
Stefan Eissing
fc273027f1
transfer: speed limiting fix for 32bit systems
When checking if a speed limit on receives applies, compare the receive
sizes using the large int type to prevent an overflow on systems where
size_t is 32bit.

Fixes #14272
Reported-by: Mamoru Tasaka
Closes #14277
2024-07-27 00:00:43 +02:00
Anthony Hu
11e248b782
wolfSSL: allow wolfSSL's implementation of kyber to be used
Closes #14268
2024-07-26 00:03:21 +02:00
Daniel Stenberg
0795014caa
lib: survive some NULL input args
The input string pointer to:

curl_escape
curl_easy_escape
curl_unescape
curl_easy_unescape

The running_handles pointer to:

curl_multi_perform
curl_multi_socket_action
curl_multi_socket_all
curl_multi_socket

Reported-by: icy17 on github
Fixes #14247
Closes #14262
2024-07-26 00:01:54 +02:00
Stefan Eissing
ae620a70a0
conncache: connection shutdown, multi_socket handling
- implement the socket hash user/reader/writer processing also
  for connections that are being shut down by the connection cache.
- split out handling of current vs. last pollset socket event handling
  into a function available in other code parts
- add `shutdown_poll` pollset to `connectdata` struct so that changes
  in the pollset can be recorded during shutdown. (The internal handle
  cannot keep it since it might be used for many connections)

Reported-by: calvin2021y on github
Fixes #14252
Closes #14257
2024-07-23 10:29:07 +02:00
Daniel Stenberg
eef17551ac
lib: Curl_posttransfer => multi_posttransfer
Moved from transfer.c to multi.c as it was only used within multi.c

Made a void, as it returned a fixed return code nothing checked.

Closes #14240
2024-07-21 00:46:50 +02:00
Daniel Stenberg
56493eea1c
multi: do a final progress update on connect failure
To fix timing metric etc

Co-authored-by: Justin Maggard
Fixes #14204
Closes #14239
2024-07-20 17:11:00 +02:00
Orgad Shaneh
1f877b0fba
md4: fix compilation with OpenSSL 1.x with md4 disabled
If OpenSSL 1.x is used, and it is configured with md4 disabled,
OPENSSL_NO_MD4 is defined in opensslconf.h, but this header was not
included before checking for this define.

Later in md4.c, openssl/md4.h is included, and it includes that header
indirectly, leading to inconsistency within md4.c.

Since the md4.h branch was taken, wincrypt.h (or others) is not
included, and later below the USE_WIN32_CRYPTO branch is taken, but the
types are not defined.

Closes #14218
2024-07-19 18:27:30 +02:00
martinevsky
8e13837e0e
ftp: remove redundant null pointer check in loop condition
Closes #14234
2024-07-19 18:24:45 +02:00
Justin Maggard
92e28f2897
mbedtls: check version before getting tls version
mbedtls_ssl_get_version_number() was added in mbedtls 3.2.0. Check for
that version before using it.

Closes #14228
2024-07-19 18:22:37 +02:00
martinevsky
e22b509754
urlapi: remove unused definition of HOST_BAD
Closes #14235
2024-07-19 18:17:53 +02:00
Daniel Stenberg
25321de30e
Revert "lib: send eos flag"
This reverts commit be93299f10.
2024-07-19 01:38:05 +02:00
Stefan Eissing
be93299f10
lib: send eos flag
Adds a `bool eos` flag to send methods to indicate that the data is the
last chunk the invovled transfer wants to send to the server.

This will help protocol filters like HTTP/2 and 3 to forward the
stream's EOF flag and also allow to EAGAIN such calls when buffers are
not yet fully flushed.

Closes #14220
2024-07-18 23:27:35 +02:00
Bhanu Prakash
c98f6fcde7
mbedtls: correct the error message for cert blob parsing failure
Closes #14224
2024-07-18 23:19:06 +02:00
Stefan Eissing
d8696dc8c0
doh: fix cleanup
When removing an easy handle that had DoH sub-easy handles going, those
were not removed from the multi handle. Their memory was reclaimed on
curl_easy_cleanup() of the owning handle, but multi still had them in
their list.

Add `Curl_doh_close()` and `Curl_doh_cleanup()` as common point for
handling the DoH resource management. Use the `multi` present in the doh
handles (if so), for removal, as the `data->multi` might already have
been NULLed at this time.

Reported-by: 罗朝辉
Fixes #14207
Closes #14212
2024-07-18 15:13:30 +02:00
Alex Snast
f504db8928
http/3: resume upload on ack if we have more data to send
Currently we're waiting for sendbuf_len_in_flight to hit zero before
resuming upload which means we're blocking and waiting for _all_ acks to
arrive before sending more data. This causes significant delays especially
when ack delay is used on the server side.

The fix addresses several issues in h3 over ngtcp2:
  - On ack we now call nghttp3_conn_resume_stream() when we have more
    data to send.
  - upload_left was incorrectly computed on CF_CTRL_DATA_DONE_SEND as
    we need to subtract the ammount of data we have in flight.
  - Remove upload_blocked_len as we Curl_bufq_write call will do the
    right thing when called from cf_ngtcp2_send.

Fixes #14198
Closes #14209
2024-07-18 15:08:03 +02:00
Daniel Stenberg
c3c7992ac7
idn: make macidn fail before trying conversion if name too long
- double the max name length to 512 bytes

Closes #14215
2024-07-18 14:47:54 +02:00
z2_
686d54baf1
idn: tweak buffer use when converting with macidn
Closes #14215
2024-07-18 14:47:42 +02:00
Orgad Shaneh
0dbc4eb06e
lib: add failure reason on bind errors
Closes #14221
2024-07-18 14:47:00 +02:00
Tal Regev
dfbdcb93ae
GHA/windows: add MSVC wolfSSL job with test
Fix the file of wolfssl.c because of this warning/error:
```
curl\lib\vtls\wolfssl.c(1017,42): error C2220: the following warning is treated as an error [curl\bld\lib\libcurl_object.vcxproj]
curl\lib\vtls\wolfssl.c(1017,42): warning C4267: 'function': conversion from 'size_t' to 'unsigned long', possible loss of data [curl\bld\lib\libcurl_object.vcxproj]
```

`size_t` in MSVC is different. Change it to `unsigned long` because
`wolfSSL_ERR_error_string_n` last argument is defined as
`unsigned long`.

Closes #14193
2024-07-16 11:56:34 +02:00
Viktor Szakats
09cdf7e531
cmake: delete unused HAVE_LIBSSH2, HAVE_LIBSOCKET macros
- `HAVE_LIBSSH2`: unused in source. Not defined in CMake.

- `HAVE_LIBSOCKET`: unused in source. Used internally in CMake.

autotools sets them implicitly, so add them to the flag comparison
ignore-list.

Closes #14178
2024-07-16 11:46:26 +02:00
Stefan Eissing
9e5b11c659
sendf: fix CRLF conversion of input
When CRLF line end conversion was enabled (--crlf), input after the last
newline in the upload buffer was not sent, if the buffer contained a
newline.

Reported-by: vuonganh1993 on github
Fixes #14165
Closes #14169
2024-07-15 23:47:33 +02:00
Stefan Eissing
f4b8b976b4
smtp: for starttls, do full upgrade
- make sure the TLS handshake after a successful STARTTLS command is
  fully done before further sending/receiving on the connection.

Reported-by: tomy2105 on github
Fixes #14166
Closes #14190
2024-07-15 23:11:21 +02:00
MonkeybreadSoftware
fd0250869f
IDN: fix ß with AppleIDN
Add flags UIDNA_NONTRANSITIONAL_TO_ASCII and
UIDNA_NONTRANSITIONAL_TO_UNICODE to encode ß correctly.

It fixes test 165.

Reported-by: Viktor Szakats
Bug: #14176
Closes #14179
2024-07-14 09:53:40 +02:00
Viktor Szakats
3765d75ce4
cmake: fix building unit1600 due to missing ssl/openssl.h
In specific builds configs, cmake failed to build test `unit1600`,
due missing an OpenSSL (or wolfSSL) header.

The test code relies on `lib/curl_ntlm_core.h`, which in turn included
TLS library headers. But, dependency header directories are not setup
in cmake for tests, because they should not normally be needed.

The issue was hidden in most builds because TLS headers are usually
found under the system prefix. One counterexample is macOS + Homebrew
LibreSSL builds, where OpenSSL is purposefully unlinked from there to
avoid a mixup with LibreSSL that resides under its own prefix. It was
also hidden in autotools, possibly because it sets up header directories
globally, tests included.

The actual bug however is that `lib/curl_ntlm_core.h` should not include
TLS headers. None of its internal users need it, and `curl_ntlm_core.c`
included them already directly.

Fix it by deleting the TLS header includes from this internal header.

Fixes:
```
In file included from curl/tests/unit/unit1600.c:27:
curl/lib/curl_ntlm_core.h:32:12: fatal error: 'openssl/ssl.h' file not found
#  include <openssl/ssl.h>
           ^~~~~~~~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/9912684737/job/27388041520#step:12:1694

Follow-up to 48eb71ade4 #10322
Cherry-picked from #14097
Closes #14172
2024-07-13 12:00:14 +02:00
Viktor Szakats
5fa534b0da
sectransp: fix clang compiler warnings, stop silencing them
Fix `-Wpointer-bool-conversion` warnings with the method suggested by
both Apple clang and mainline llvm. This was already tried and dropped
in #1705 (in year 2017), but the issue reported there no longer
replicates.

Verified with Apple clang 14, llvm 15, llvm 18 and gcc 11, 14 that the
generated objects are bit by bit identical before and after this patch.

Also:
- stop silencing `-Wtautological-pointer-compare`. This warning don't
  seem to be appearing anymore (with or without this patch), at least
  with the tested compilers and SDKs (clang 13.1.6-16.0.0beta, llvm 15,
  18, gcc 11, 14) and minimum macOS target of 10.8. Older targets fail
  to build curl with SecureTransport.

- silence `-Wunreachable-code` for clang only. Previously I applied it
  also to GCC, by mistake.
  Ref: 8d7172d20a

Apple clang `-Wpointer-bool-conversion`:
```
curl/lib/vtls/sectransp.c:1103:6: error: address of function 'SSLCreateContext' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
  if(SSLCreateContext) {  /* use the newer API if available */
  ~~ ^~~~~~~~~~~~~~~~
curl/lib/vtls/sectransp.c:1103:6: note: prefix with the address-of operator to silence this warning
  if(SSLCreateContext) {  /* use the newer API if available */
     ^
     &
```
Ref: https://github.com/curl/curl/actions/runs/9819538439/job/27113201384#step:8:382

llvm `-Wpointer-bool-conversion`:
```
curl/lib/vtls/sectransp.c:2663:8: error: address of function 'SSLCreateContext' will always evaluate to 'true' [-Werror,-Wpointer-bool-conversion]
    if(SSLCreateContext)
    ~~ ^~~~~~~~~~~~~~~~
curl/lib/vtls/sectransp.c:2663:8: note: prefix with the address-of operator to silence this warning
    if(SSLCreateContext)
       ^
       &
```
Ref: https://github.com/curl/curl/actions/runs/9819538439/job/27113200291#step:8:417

gcc still needs `-Waddress` suppressed to avoid these:
```
curl/lib/vtls/n/sectransp.c: In function 'getsubject':
curl/lib/vtls/n/sectransp.c:379:6: warning: the address of 'SecCertificateCopyLongDescription' will always evaluate as 'true' [-Waddress]
  379 |   if(&SecCertificateCopyLongDescription)
      |      ^
[...]
```

Follow-up to 59cadacfcc #14128
Follow-up to af271ce9b9 #1722
Follow-up to 2b7ce3f56d #1706
Cherry-picked from #14097
Closes #14162
2024-07-13 12:00:13 +02:00
Viktor Szakats
6343034dd1
tidy-up: adjust casing of project names
Mostly TLS/SSH project name.

Closes #14160
2024-07-12 13:56:16 +02:00
Stephen Farrell
6a5bb68556
doh: fix leak and zero-length HTTPS RR crash
This PR fixes a leak and a crash that can happen when curl encounters
bad HTTPS RR values in DNS. We're starting to do better testing of that
kind of thing and e.g. have published bad HTTPS RR values at
dodgy.test.defo.ie.

Closes #14151
2024-07-12 12:16:56 +02:00
Viktor Szakats
ff784af461
build: fix llvm 17 and older + macOS SDK 14.4 and newer
Fixup faulty target macro initialization in macOS SDK since v14.4 (as of
15.0 beta). The SDK target detection in `TargetConditionals.h` correctly
detects macOS, but fails to set the macro's old name `TARGET_OS_OSX`,
then continues to set it to a default value of 0. Other parts of the SDK
still rely on the old name, and with this inconsistency our builds fail
due to missing declarations. It happens when using mainline llvm older
than v18. Later versions fixed it by predefining these target macros,
avoiding the faulty dynamic detection. gcc is not affected (for now)
because it lacks the necessary dynamic detection features, so the SDK
falls back to a codepath that sets both the old and new macro to 1.

Also move the `TargetConditionals.h` include to the top of to make sure
including it also for c-ares builds, combined with SecureTransport or
other curl features that may call use an Apple SDK.

Before this patch, affected build combinations (e.g. in GHA runners,
llvm@15 + Xcode 15.3, 15.4, 16.0 with their default SDKs +
SecureTransport) fail with:
```
  error: use of undeclared identifier 'noErr'
    or 'SecCertificateCopyLongDescription'
    or 'SecItemImportExportKeyParameters'
    or 'SecExternalFormat'
    or 'SecExternalItemType'
    or 'SEC_KEY_IMPORT_EXPORT_PARAMS_VERSION'
```

Example:
```
curl/lib/vtls/sectransp.c:311:18: error: use of undeclared identifier 'noErr'
  OSStatus rtn = noErr;
                 ^
curl/lib/vtls/sectransp.c:379:7: error: use of undeclared identifier 'SecCertificateCopyLongDescription'
  if(&SecCertificateCopyLongDescription)
      ^
curl/lib/vtls/sectransp.c:381:7: error: call to undeclared function 'SecCertificateCopyLongDescription'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
      SecCertificateCopyLongDescription(NULL, cert, NULL);
      ^
curl/lib/vtls/sectransp.c:380:25: error: incompatible integer to pointer conversion assigning to 'CFStringRef' (aka 'const struct __CFString *') from 'int' [-Wint-conversion]
    server_cert_summary =
                        ^
[...]
```
Ref: https://github.com/curl/curl/actions/runs/9893867519/job/27330135969#step:10:22

llvm v18 patches implementing the predefined macros:
https://github.com/llvm/llvm-project/pull/74676
6e1f19168b
https://github.com/llvm/llvm-project/pull/82833
e5ed7b6e2f

Cherry-picked from #14097
Closes #14159
2024-07-12 00:36:25 +02:00
Viktor Szakats
e91fcbac7d
macos: undo availability macro enabled by Homebrew gcc
Homebrew gcc builds starting with 12.4.0, 13.3.0 and 14.1.0 enabled
the `availability` attribute.

This broke builds because the way the Apple SDK uses attributes (when
available) are incompatible with how gcc accepts them. Causing these
errors:
```
  error: attributes should be specified before the declarator in a function definition
  error: expected ',' or '}' before
```

Upstream commits implementing the `availability` macro:
gcc-12: fd5530b7cb
gcc-13: cb7e4eca68
gcc-14: ff62a10886

The project above is a Darwin gcc compatibility pack, that is applied
to Homebrew gcc builds.

This patch works by redefining the `availability` macro to an invalid
value, making `__has_attribute(availability)` checks fail, stopping
Apple SDK from inserting the incompatible attributes.

It also replaces the previous, local workaround for `lib/macos.c`.

Example with gcc 12.4.0 with macOS SDK 14.0 (Xcode 15.0.1):
```
In file included from <path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h:54,
                 from <path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/SystemConfiguration.framework/Headers/SCDynamicStoreCopySpecific.h:30,
                 from /Users/runner/work/curl/curl/lib/macos.c:33,
                 from /Users/runner/work/curl/curl/build/lib/CMakeFiles/libcurl_shared.dir/Unity/unity_0_c.c:244:
<path-to-sdk>/MacOSX14.0.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFUserNotification.h:126:1: error: attributes should be specified before the declarator in a function definition
  126 | CF_INLINE CFOptionFlags CFUserNotificationCheckBoxChecked(CFIndex i) API_AVAILABLE(macos(10.0)) API_UNAVAILABLE(ios, watchos, tvos) {return ((CFOptionFlags)(1UL << (8 + i)));}
      | ^~~~~~~~~
```
Ref: https://github.com/curl/curl/actions/runs/9787982387/job/27025351601?pr=14096#step:7:18

The gcc vs. llvm/clang incompatibility possibly tracked here upstream:
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108796
More info:
  https://github.com/llvm/llvm-project/issues/81767
  8433baadec
  https://discourse.llvm.org/t/changing-attribute-ast-printing-location-for-gcc-compatibility/73215
  https://reviews.llvm.org/D159362

Follow-up to db135f8d72 #14119
Ref: https://github.com/curl/curl/pull/14091#issuecomment-2222703468
Fixes #13700
Cherry-picked from #14097
Closes #14155
2024-07-12 00:32:39 +02:00
CMD
c2e427cc93
hostip: skip error check for infallible function call
Closes #14147
2024-07-10 16:14:06 +02:00
Daniel Stenberg
5637ca1aab
cf-socket: remove two "useless" assignments
'nread' is already -1, no need to assign it again

Pointed out by CodeSonar

Closes #14145
2024-07-10 14:40:36 +02:00
Viktor Szakats
baa3270846
build: fix llvm 16 or older + Xcode 15 or newer, and gcc
Xcode v15 (2023) or newer requires the built-in macro
`__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__`. This macro is missing from
mainline llvm versions released earlier. llvm v17 introduced it here:
c8e2dd8c6f

This patch defines the missing macro when the necessary conditions
align, by using the value via the macro's old name.

The issue affected SecureTransport builds: The SecureTransport code,
`lib/md4.c` and `lib/md5.c`.

Existing gcc versions (as of v14) also don't define this macro, so apply
the patch to it as well. Even though gcc is incompatible in other ways,
so this isn't fixing an actual curl build case that I could find yet.

GHA macOS runner images have llvm v15 pre-installed, which broke builds
when building with an affected Xcode:
```
curl/lib/md4.c:80:14: error: '__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__' is not defined, evaluates to 0 [-Werror,-Wundef]
            (__MAC_OS_X_VERSION_MIN_REQUIRED < 101500)) || \
             ^
/Applications/Xcode_15.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/AvailabilityInternal.h:40:53: note: expanded from macro '__MAC_OS_X_VERSION_MIN_REQUIRED'
            #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
                                                    ^
In file included from curl/build/lib/CMakeFiles/libcurl_shared.dir/Unity/unity_0_c.c:250:
curl/lib/md5.c:75:14: error: '__ENVIRONMENT_OS_VERSION_MIN_REQUIRED__' is not defined, evaluates to 0 [-Werror,-Wundef]
            (__MAC_OS_X_VERSION_MIN_REQUIRED < 101500)) || \
             ^
/Applications/Xcode_15.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/include/AvailabilityInternal.h:40:53: note: expanded from macro '__MAC_OS_X_VERSION_MIN_REQUIRED'
            #define __MAC_OS_X_VERSION_MIN_REQUIRED __ENVIRONMENT_OS_VERSION_MIN_REQUIRED__
                                                    ^
2 errors generated.
```
Ref: https://github.com/curl/curl/actions/runs/9811974634/job/27095218578#step:4:20

Cherry-picked from #14097
Closes #14134
2024-07-10 11:42:46 +02:00
Viktor Szakats
59cadacfcc
build: sync warning options between autotools, cmake & compilers
- cmake: enable Apple-specific `-Werror=partial-availability` to match
  autotools.

- autotools: enable `-pedantic-errors` with llvm/clang to match gcc and
  CMake.

- autotools: enable `-Werror-implicit-function-declaration` for
  llvm/clang to match gcc.

- cmake: enable `-Werror-implicit-function-declaration` to match
  autotools.

- move `-Wpointer-bool-conversion` from autotools to the local file
  (`sectransp.c`) it was meant to apply. This way it applies to all
  build methods.

- autotoos: show `CURL_CFLAG_EXTRAS` in the `./configure` summary.
  (it may contain `-Werror` and/or `-pedentic-errors`.)

Cherry-picked from #14097
Closes #14128
2024-07-10 11:30:40 +02:00