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

Make json_object_object_add() indicate success or failure, test fix #61

Closed
wants to merge 2 commits into from

Conversation

TheCount
Copy link
Contributor

@TheCount TheCount commented Jan 8, 2013

json_object_object_add() now indicates success or failure via its return value. The previous behaviour, namely to exit the program on failure, is cumbersome in large-scale applications.

Note that the change of return value from void to int may break the ABI so that programs using json-c may have to be rebuilt.

Unrelated to this change, I found I had to adjust the expected output of test_parse for a successful build.

* Return value of json_object_object_add() changed from void to int.
  Return value now indicates success or failure.

* Check whether allocations are successful.

* Do not exit program from within the library.
@hawicz
Copy link
Member

hawicz commented Nov 30, 2015

I'm mostly convinced that changing the return value from void to int won't change the ABI (see http://stackoverflow.com/questions/15626579/c-abi-is-it-safe-to-change-void-function-to-return-int) so this change should be merged. At this point, I'll need to merge it by hand.

The fix to test_parse has already been applied.

@hawicz
Copy link
Member

hawicz commented Nov 30, 2015

ugh, there's is some pretty bogus use of goto's in this change. :(

@hawicz
Copy link
Member

hawicz commented Dec 9, 2015

After dealing with the steaming pile that is git, I finally managed to get the change to json_object_object_add manually merged in.

@hawicz hawicz closed this Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants