www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16735] New: curl_easy_getinfo accepts wrong CURL type


          Issue ID: 16735
           Summary: curl_easy_getinfo accepts wrong CURL type
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: andre s-e-a-p.de

Please check following coding:

void main()
    Curl curl;
    curl.set(CurlOption.url, "https://www.google.com");

    double d;
    curl_easy_getinfo(&curl, CurlInfo.namelookup_time, &d);

curl_easy_getinfo expects a pointer to CURL but a pointer to Curl is provided.
The example compiles but the returned value is wrong.

See also the explanation from Adam:
http://forum.dlang.org/post/xsamfpoivuhwdbvnkgek forum.dlang.org

Nov 23 2016