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

OS400 compile failures when including QADRT and link fail trying to export deprecated routines #10266

Closed
jonrumsey opened this issue Jan 10, 2023 · 0 comments
Labels

Comments

@jonrumsey
Copy link
Contributor

I did this

Compile and link libCurl 7.78.0 on OS400 V7R4M0 (with or without GSKit)

CZM1002:  cfilters.c.819, 84.32: CZM0215(20) Too many arguments specified for macro close.
CZM1003:  cfilters.c.819, 84.18: CZM0022(30) "close_a" is not a member of "const struct Curl_cftype".
CZM1002:  cfilters.c.819, 156.22: CZM0215(20) Too many arguments specified for macro close.
CZM1003:  cfilters.c.819, 156.14: CZM0022(30) "close_a" is not a member of "const struct Curl_cftype".
CZS0601:  Module CFILTERS is not created because statement errors occurred.
CZM0613:  The compilation failed.

CZM1002:  socks.c.819, 1199.32: CZM0215(20) Too many arguments specified for macro close.
CZM1003:  socks.c.819, 1199.18: CZM0022(30) "close_a" is not a member of "const struct Curl_cftype".
CZS0601:  Module SOCKS is not created because statement errors occurred.
CZM0613:  The compilation failed.

CZM1002:  vtls/vtls.c.819, 1192.21: CZM0215(20) Too many arguments specified for macro close.
CZM1003:  vtls/vtls.c.819, 1192.13: CZM0022(30) "close_a" is not a member of "const struct Curl_ssl".
CZM1002:  vtls/vtls.c.819, 1445.23: CZM0215(20) Too many arguments specified for macro close.
CZM1003:  vtls/vtls.c.819, 1445.15: CZM0022(30) "close_a" is not a member of "const struct Curl_ssl".
CZM1002:  vtls/vtls.c.819, 1495.32: CZM0215(20) Too many arguments specified for macro close.
CZM1003:  vtls/vtls.c.819, 1495.18: CZM0022(30) "close_a" is not a member of "const struct Curl_cftype".
CZS0601:  Module VTLS is not created because statement errors occurred.
CZM0613:  The compilation failed.

These compile errors are because there is now a function pointer called close which takes two arguments and the preprocessor macro expansion can't distinguish... by default including the ASCII runtime header unistd.h
#define close(a) as close_a(a)

This can be avoided by defining 'qadrt_use_inline' which avoids the define and instead inlines the redirection.

There is also a link error where the list of exported routines is generated by scraping the header files for routines that are declared as CURL_EXTERN but routines qualified with CURL_DEPRECATED(...) now fail to be correctly identified by the regex matching in the sed script.

I expected the following

Clean build

curl/libcurl version

libCurl 7.78.0

operating system

OS400 V7R4M0

@bagder bagder added the build label Jan 10, 2023
@bagder bagder linked a pull request Jan 10, 2023 that will close this issue
@bagder bagder closed this as completed in 9749a37 Jan 10, 2023
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
Adjust how exports list is generated from header files to account for
declarations across multiple lines and CURL_DEPRECATED(...) tags.

Update initscript.sh

Specify qadrt_use_inline to prevent unistd.h in ASCII runtime defining
close(a) -> close_a(a)

Fixes curl#10266
Closes curl#10267
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants