m6w6 / ext-http

Extended HTTP Support
BSD 2-Clause "Simplified" License
79 stars 22 forks source link

Glitch in CURL_VERSION_TLSAUTH_SRP autoconf probe #133

Closed fweimer-rh closed 2 months ago

fweimer-rh commented 11 months ago

The double "" in "SRP"" introduce a syntax error, causing this probe to fail always:

https://github.com/m6w6/ext-http/blob/ff2148e3f14ab76babbabc7a759fc80fefd1e769/autoconf/pecl/libcurl.m4#L136C1-L136C90

conftest.c: In function 'main':
conftest.c:54:129: warning: missing terminating " character
   54 |                                                 int set_failure = curl_easy_setopt(curl_easy_init(), CURLOPT_TLSAUTH_TYPE, "SRP"");
      |                                                                                                                                 ^
conftest.c:57:1: error: unterminated argument list invoking macro "curl_easy_setopt"
   57 | 
      | ^
conftest.c:54:67: error: initialization of 'int' from 'CURLcode (*)(CURL *, CURLoption, ...)' {aka 'CURLcode (*)(void *, CURLoption, ...)'} makes integer from pointer without a cast
   54 |                                                 int set_failure = curl_easy_setopt(curl_easy_init(), CURLOPT_TLSAUTH_TYPE, "SRP"");
      |                                                                   ^~~~~~~~~~~~~~~~
conftest.c:54:49: error: expected ',' or ';' at end of input
   54 |                                                 int set_failure = curl_easy_setopt(curl_easy_init(), CURLOPT_TLSAUTH_TYPE, "SRP"");
      |                                                 ^~~
conftest.c:54:49: error: expected declaration or statement at end of input
conftest.c:54:53: warning: unused variable 'set_failure' [-Wunused-variable]
   54 |                                                 int set_failure = curl_easy_setopt(curl_easy_init(), CURLOPT_TLSAUTH_TYPE, "SRP"");
      |                                                     ^~~~~~~~~~~
conftest.c:53:53: warning: unused variable 'has_feature' [-Wunused-variable]
   53 |                                                 int has_feature = curl_version_info(CURLVERSION_NOW)->features & CURL_VERSION_TLSAUTH_SRP;
      |                                                     ^~~~~~~~~~~

When fixing this, please make sure that the probe, when successful, does not trigger any compiler warnings related to integer/pointer conversion or incompatible pointer types.

Found as a side effect of:

m6w6 commented 9 months ago

Now, that's a catch. 🖖

m6w6 commented 9 months ago

Fix breaks "the fix"

m6w6 commented 2 months ago

Finally? fixed in 481e18662d8fe7eae4060693aa3c447675593366