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

Windows: json-c 0.17 compatibility with ssize_t type definition (1.0.4) #1064

Conversation

micahsnyder
Copy link
Contributor

Backport of #1002


json-c 0.17 defines the ssize_t type using a typedef on Windows. We have been setting ssize_t for Windows to a different type using a #define instead of a typedef.

We should have been using a typedef since it is a type. However, we must also match the exact type they're setting it to or else the compiler will baulk because the types are different.

Note: in C11, it's fine to use typedef the same type more than once, so long as you're defining it the same every time.

json-c 0.17 defines the ssize_t type using a typedef on Windows.
We have been setting ssize_t for Windows to a different type using
a #define instead of a typedef.

We should have been using a typedef since it is a type.
However, we must also match the exact type they're setting it to or else
the compiler will baulk because the types are different.

Note: in C11, it's fine to use typedef the same type more than once, so
long as you're defining it the same every time.
@micahsnyder micahsnyder merged commit 7c6eea2 into Cisco-Talos:dev/1.0.4 Oct 20, 2023
6 of 23 checks passed
@micahsnyder micahsnyder deleted the CLAM-2422-json-c-0.17-compatibility-1.0.4 branch October 20, 2023 21:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants