Skip to content

Conversation

@rouault
Copy link
Contributor

@rouault rouault commented Jan 12, 2022

No description provided.

@hawicz
Copy link
Member

hawicz commented Feb 19, 2022

I think at least some (all?) of these warnings are actual problems, and rather than papering over them by casting to int, we need to take adjust the types used. e.g. printbuf_memappend() should take a size_t, int ret should be size_t ret instead, etc...

That might break API/ABI compatibility, so I'll need to take a closer look at each change.

hawicz added a commit that referenced this pull request Jul 31, 2022
@hawicz
Copy link
Member

hawicz commented Jul 31, 2022

I fixed some of these issues in commit bdd5e03. Changes to json_tokener.c and json_object.c are still needed.

@hawicz
Copy link
Member

hawicz commented Jul 7, 2023

Fixing this means at least changing the size and bpos members of struct printbuf to be size_t.
That is an ABI breaking change, and that doesn't even include changing the size of various function parameters too, so actually fixing this will need to wait until we're ready for a 1.0 release.

@hawicz hawicz added the release-1.0 Features and issues for a potential 1.0 release label Jul 7, 2023
@hmh
Copy link

hmh commented Apr 28, 2025

If you're going to change the API/ABI, please do use size_t instead of int for every object-size-related parameter in the API, and please use const on parameters taken by reference that are not going to be modified by the function call (i.e. "const struct json_object *jo" if *jo is not going to be modified by that API function).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release-1.0 Features and issues for a potential 1.0 release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants