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 build break in tftp.c, 5th argument of Curl_os400_sendto() should be const #10539

Closed
jonrumsey opened this issue Feb 16, 2023 · 0 comments
Labels

Comments

@jonrumsey
Copy link
Contributor

I did this

Build 7.88, failed in TFTP module with following const mismatch error at line 531;

CZM0280(30) Function argument assignment between types "struct sockaddr*" and "const struct sockaddr*" is not allowed.

    senddata = sendto(state->sockfd, (void *)state->spacket.data,
                      (SEND_TYPE_ARG3)sbytes, 0,
                      &data->conn->remote_addr->sa_addr,
                      data->conn->remote_addr->addrlen);

This appears to have been uncovered by #10213.

The root cause is OS400 where in setup-os400.h, sendto() is hash defined to use Curl_os400_sendto(), however the prototype for the OS400 wrapper to deal with EBCDIC/ASCII conversions doesn't match the usual POSIX prototype of;

ssize_t sendto(int sockfd, const void *buf, size_t len, int flags,
               const struct sockaddr *dest_addr, socklen_t addrlen);

I expected the following

Clean build

curl/libcurl version

7.88

[curl -V output]

operating system

OS400 V7R5M0

@vszakats vszakats added the build label Feb 16, 2023
@bagder bagder closed this as completed in 8572157 Feb 17, 2023
bch pushed a commit to bch/curl that referenced this issue Jul 19, 2023
Add const qualifier to 5th argument of Curl_os400_sendto()

Make OS400 wrapper for sendto match the normal prototype of sendto()
with a const qualifier.

Fixes curl#10539
Closes curl#10548
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

2 participants