Skip to content

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

Merged
val-ms merged 1 commit intoCisco-Talos:dev/1.0.4from
val-ms:CLAM-2422-json-c-0.17-compatibility-1.0.4
Oct 20, 2023
Merged

Windows: json-c 0.17 compatibility with ssize_t type definition (1.0.4)#1064
val-ms merged 1 commit intoCisco-Talos:dev/1.0.4from
val-ms:CLAM-2422-json-c-0.17-compatibility-1.0.4

Conversation

@val-ms
Copy link
Contributor

@val-ms val-ms commented Oct 20, 2023

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.
@val-ms val-ms merged commit 7c6eea2 into Cisco-Talos:dev/1.0.4 Oct 20, 2023
@val-ms val-ms 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