Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glitch in CURL_VERSION_TLSAUTH_SRP autoconf probe #133

Open
fweimer-rh opened this issue Nov 29, 2023 · 2 comments
Open

Glitch in CURL_VERSION_TLSAUTH_SRP autoconf probe #133

fweimer-rh opened this issue Nov 29, 2023 · 2 comments

Comments

@fweimer-rh
Copy link

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
Copy link
Owner

m6w6 commented Feb 5, 2024

Now, that's a catch. 🖖

@m6w6 m6w6 closed this as completed in 25e50bf Feb 5, 2024
m6w6 added a commit that referenced this issue Feb 5, 2024
* Fix incompatible pointer types (32-bit) (see gh issue #134)
* Fix glitch in CURL_VERSION_TLSAUTH_SRP autoconf probe (see gh issue #133)
@m6w6
Copy link
Owner

m6w6 commented Feb 5, 2024

Fix breaks "the fix"

@m6w6 m6w6 reopened this Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants