Skip to content

curl_easy_getinfo type checking failed #5432

Description

@Billyzou0741326

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions