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

`curl_easy_getinfo` type checking failed #5432

Closed
Billyzou0741326 opened this issue May 20, 2020 · 4 comments
Closed

`curl_easy_getinfo` type checking failed #5432

Billyzou0741326 opened this issue May 20, 2020 · 4 comments

Comments

@Billyzou0741326
Copy link
Contributor

@Billyzou0741326 Billyzou0741326 commented May 20, 2020

I was using the CURLOPT_PRIVATE to store some data. Here's what I did,

struct http_request_private_data *priv_data;
curl_easy_getinfo(easy_curl, CURLINFO_PRIVATE, &priv_data);

But then when I compiled with Linux gcc, I got this error (as in issue #846),

curl/typecheck-gcc.h:122:13: error: call to ‘_curl_easy_getinfo_err_string’ declared with attribute warning: curl_easy_getinfo expects a pointer to 'char *' for this info [-Werror]
             _curl_easy_getinfo_err_string();

Curiously, there was no warning when I compiled with -O0 flag, without making any changes to the code.
When using any other optimization flags, -O2 for instance, the warning shows up.

curl/libcurl version

curl-config --version
libcurl 7.70.0

operating system

Linux 4.15.0-91-generic #92-Ubuntu SMP Fri Feb 28 11:09:48 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

@bagder
Copy link
Member

@bagder bagder commented May 20, 2020

Ack. CURLINFO_PRIVATE is set to have a CURLINFO_STRING type which then leads to that. We can't change the number now but we can add an exception to typecheck-gcc.h.

Thanks for this report!

@bagder
Copy link
Member

@bagder bagder commented May 20, 2020

Uh, why close it?

bagder added a commit that referenced this issue May 20, 2020
Reported-by: Billyzou0741326 on github
Fixes #5432
@bagder
Copy link
Member

@bagder bagder commented May 20, 2020

@Billyzou0741326 can you check if the fix in #5436 is fine for you?

@minamiktr
Copy link

@minamiktr minamiktr commented May 20, 2020

Yes, compiled successfully. Thank you!

bagder added a commit that referenced this issue May 20, 2020
Reported-by: Billyzou0741326 on github
Fixes #5432
Closes #5436
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

3 participants
You can’t perform that action at this time.