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

IBMi build is broken for 8.11.0 release #15566

Closed
andrewkirillov-ibm opened this issue Nov 13, 2024 · 5 comments
Closed

IBMi build is broken for 8.11.0 release #15566

andrewkirillov-ibm opened this issue Nov 13, 2024 · 5 comments
Labels

Comments

@andrewkirillov-ibm
Copy link
Contributor

I did this

Compile 8.11.0 on IBM i V7R4M0 system.

CZM1003:  CCSIDCURL__819.c, 1201.14: CZM0122(30) Expecting pointer to struct or union.
CZM1003:  CCSIDCURL__819.c, 1246.7: CZM0122(30) Expecting pointer to struct or union.
CZM1003:  CCSIDCURL__819.c, 1251.5: CZM0122(30) Expecting pointer to struct or union.

The issue seem to be introduced by fixing #15289, which defines CURL as void now. As such, curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...) gets broken dereferencing void pointer to access struct Curl_easy fields.

I expected the following

Clean build

curl/libcurl version

8.11.0

operating system

OS400 V7R4M0

@vszakats vszakats added the build label Nov 13, 2024
@andrewkirillov-ibm
Copy link
Contributor Author

andrewkirillov-ibm commented Nov 13, 2024

The fix which solved the build for me may looks some like this:
packages/OS400/ccsidcurl.c

@@ -1070,10 +1070,11 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
   va_list arg;
   char *s;
   char *cp = NULL;
   unsigned int ccsid;
   curl_off_t pfsize;
+  struct Curl_easy *data = easy;
 
   va_start(arg, tag);
 
   switch(tag) {
 
@@ -1193,11 +1194,11 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
        prior to this call. In this case, convert the given byte count and
        replace the length according to the conversion result. */
     s = va_arg(arg, char *);
     ccsid = va_arg(arg, unsigned int);
 
-    pfsize = easy->set.postfieldsize;
+    pfsize = data->set.postfieldsize;
 
     if(!s || !pfsize || ccsid == NOCONV_CCSID || ccsid == ASCII_CCSID) {
       result = curl_easy_setopt(easy, CURLOPT_COPYPOSTFIELDS, s);
       break;
     }
@@ -1238,16 +1239,16 @@ curl_easy_setopt_ccsid(CURL *easy, CURLoption tag, ...)
       if(pfsize < 0) {
         result = CURLE_OUT_OF_MEMORY;
         break;
       }
 
-      easy->set.postfieldsize = pfsize;         /* Replace data size. */
+      data->set.postfieldsize = pfsize;         /* Replace data size. */
       s = cp;
     }
 
     result = curl_easy_setopt(easy, CURLOPT_POSTFIELDS, s);
-    easy->set.str[STRING_COPYPOSTFIELDS] = s;   /* Give to library. */
+    data->set.str[STRING_COPYPOSTFIELDS] = s;   /* Give to library. */
     break;
 
   default:
     if(tag / 10000 == CURLOPTTYPE_BLOB) {
       struct curl_blob *bp = va_arg(arg, struct curl_blob *);

@bagder
Copy link
Member

bagder commented Nov 13, 2024

Any chance you can provide this patch as a full fledged PR?

@andrewkirillov-ibm
Copy link
Contributor Author

Will work on it.

@andrewkirillov-ibm
Copy link
Contributor Author

Any chance I could get write access so I could create branch and raise PRs?

@jzakrzewski
Copy link
Contributor

@andrewkirillov-ibm a typical workflow looks like this:

  • fork this repository
  • create appropriate branch in your fork
  • then make a PR from your fork into the main repo

andrewkirillov-ibm added a commit to andrewkirillov-ibm/curl that referenced this issue Nov 13, 2024
Fixing issue curl#15566, where IBMi build got broken after recent change to CURL type definition.
@jay jay closed this as completed in 04b9054 Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

4 participants