]> granicus.if.org Git - json-c/log
json-c
4 years agoMerge pull request #589 from Xyene/detect-broken-rdrand
Eric Hawicz [Mon, 4 May 2020 01:13:48 +0000 (21:13 -0400)]
Merge pull request #589 from Xyene/detect-broken-rdrand

Detect broken RDRAND during initialization

4 years agoDetect broken RDRAND during initialization
Tudor Brindus [Sat, 2 May 2020 01:09:22 +0000 (21:09 -0400)]
Detect broken RDRAND during initialization

Some CPUs advertise RDRAND in CPUID, but return 0xFFFFFFFF
unconditionally. To avoid locking up later, test RDRAND during
initialization, and if it returns 0xFFFFFFFF, mark it as nonexistent.

Fixes #588.

4 years agoMerge pull request #590 from Xyene/fix-cpuid-segfault
Eric Hawicz [Sun, 3 May 2020 18:52:31 +0000 (14:52 -0400)]
Merge pull request #590 from Xyene/fix-cpuid-segfault

Fix segmentation fault in CPUID check

4 years agoFix segmentation fault in CPUID check
Tudor Brindus [Sat, 2 May 2020 02:24:20 +0000 (22:24 -0400)]
Fix segmentation fault in CPUID check

4 years agoFix cmake-configure to accept "--prefix=<foo>" in addition to "--prefix <foo>" (see...
Eric Haszlakiewicz [Sun, 3 May 2020 03:50:16 +0000 (03:50 +0000)]
Fix cmake-configure to accept "--prefix=<foo>" in addition to "--prefix <foo>" (see also Issue #591)

4 years agoAdd an initial version of a benchmarking harness for json-c, to be able to more easil...
Eric Haszlakiewicz [Mon, 27 Apr 2020 04:00:00 +0000 (04:00 +0000)]
Add an initial version of a benchmarking harness for json-c, to be able to more easily compare the performance of different library versions.

4 years agoExtend the CMakeLists.txt in the apps directory to be usable as a standalone build...
Eric Haszlakiewicz [Sun, 26 Apr 2020 04:02:36 +0000 (04:02 +0000)]
Extend the CMakeLists.txt in the apps directory to be usable as a standalone build, to link against other versions of json-c.
Tweak json_parse.c slightly to allow it to build against older json-c versions.

4 years agoThe json_parse command line app doesn't build on Windows, disable it.
Eric Haszlakiewicz [Tue, 21 Apr 2020 21:35:41 +0000 (21:35 +0000)]
The json_parse command line app doesn't build on Windows, disable it.

4 years agoAdd an apps directory, and a json_parse program to parse an input file and report...
Eric Haszlakiewicz [Tue, 21 Apr 2020 03:51:16 +0000 (03:51 +0000)]
Add an apps directory, and a json_parse program to parse an input file and report on memory usage.
This is intended to provide a way, during development, to test out the memory
and performance impacts of a change.

4 years agoAdd a JSON_TOKENER_ALLOW_TRAILING_CHARS flag for json_tokener_set_flags() to allow...
Eric Haszlakiewicz [Mon, 20 Apr 2020 16:06:34 +0000 (16:06 +0000)]
Add a JSON_TOKENER_ALLOW_TRAILING_CHARS flag for json_tokener_set_flags() to allow multiple objects to be parsed from input even when JSON_TOKENER_STRICT is set.

4 years agoAdd an tok_flags field to explicitly specify tokener flags in test_parse and eliminat...
Eric Haszlakiewicz [Mon, 20 Apr 2020 15:13:10 +0000 (15:13 +0000)]
Add an tok_flags field to explicitly specify tokener flags in test_parse and eliminate the previous bogus calls to json_tokener_set_flags()

4 years agoIssue #471: always create directories with mode 0755, regardless of umask.
Eric Haszlakiewicz [Tue, 21 Apr 2020 03:19:17 +0000 (03:19 +0000)]
Issue #471: always create directories with mode 0755, regardless of umask.

4 years agoIssue #585: don't install config.h
Eric Haszlakiewicz [Tue, 21 Apr 2020 01:13:21 +0000 (01:13 +0000)]
Issue #585: don't install config.h

4 years agoAdd a few missing git commands to the release checklist, and change the S3 storage...
Eric Haszlakiewicz [Sun, 19 Apr 2020 04:17:29 +0000 (04:17 +0000)]
Add a few missing git commands to the release checklist, and change the S3 storage to "Standard", since it's actually (barely) cheaper than "Reduced Redundancy" now.

4 years agoUpdate the master branch to version 0.0.14.99
Eric Haszlakiewicz [Sun, 19 Apr 2020 03:57:08 +0000 (03:57 +0000)]
Update the master branch to version 0.0.14.99

4 years agoFill in the ChangeLog for the upcoming 0.14 release.
Eric Haszlakiewicz [Sun, 19 Apr 2020 01:31:48 +0000 (01:31 +0000)]
Fill in the ChangeLog for the upcoming 0.14 release.

4 years agoFill in a few more pre-release steps to match what we've done for the 0.14 release.
Eric Haszlakiewicz [Sun, 19 Apr 2020 01:28:24 +0000 (01:28 +0000)]
Fill in a few more pre-release steps to match what we've done for the 0.14 release.
Move the list of contributors to the AUTHORS file.

4 years agoRewrite the issued_closed_for_* files so they display a bit nicer.
Eric Haszlakiewicz [Sat, 18 Apr 2020 03:22:52 +0000 (03:22 +0000)]
Rewrite the issued_closed_for_* files so they display a bit nicer.

4 years agoExplicitly mark several things in json_tokener deprecated.
Eric Haszlakiewicz [Sat, 18 Apr 2020 02:42:46 +0000 (02:42 +0000)]
Explicitly mark several things in json_tokener deprecated.

4 years agoRe-do clang-format.
Eric Haszlakiewicz [Sat, 18 Apr 2020 02:14:13 +0000 (02:14 +0000)]
Re-do clang-format.

4 years agoMake json_abort() internal to json_object.c
Eric Haszlakiewicz [Sat, 18 Apr 2020 02:05:37 +0000 (02:05 +0000)]
Make json_abort() internal to json_object.c

4 years agoMake json_tokener_validate_utf8() internal to json_tokener.c, and improve the docs...
Eric Haszlakiewicz [Sat, 18 Apr 2020 02:02:06 +0000 (02:02 +0000)]
Make json_tokener_validate_utf8() internal to json_tokener.c, and improve the docs a bit.

4 years agoMerge pull request #582 from dota17/list_closed_issue_pr
Eric Haszlakiewicz [Fri, 17 Apr 2020 17:32:17 +0000 (13:32 -0400)]
Merge pull request #582 from dota17/list_closed_issue_pr

add the list of issues& prs closed

4 years agoupdate
dota17 [Fri, 17 Apr 2020 01:40:24 +0000 (09:40 +0800)]
update

4 years agomanual adjustment
dota17 [Thu, 16 Apr 2020 08:30:14 +0000 (16:30 +0800)]
manual adjustment

4 years agoadd the list of issues& prs closed
dota17 [Thu, 16 Apr 2020 08:15:04 +0000 (16:15 +0800)]
add the list of issues& prs closed

4 years agoMerge pull request #524 from dota17/addTestCase_obj_token
Eric Haszlakiewicz [Thu, 16 Apr 2020 03:35:21 +0000 (23:35 -0400)]
Merge pull request #524 from dota17/addTestCase_obj_token

Increase coverage

4 years agoMerge pull request #581 from Jehan/wip/Jehan/no-strict-prototypes-windows
Eric Haszlakiewicz [Thu, 16 Apr 2020 03:32:59 +0000 (23:32 -0400)]
Merge pull request #581 from Jehan/wip/Jehan/no-strict-prototypes-windows

CMakeLists: do not enforce strict prototypes on Windows.

4 years agoremove unsuitable case
dota17 [Wed, 15 Apr 2020 12:06:12 +0000 (20:06 +0800)]
remove unsuitable case

4 years agoCMakeLists: do not enforce strict prototypes on Windows.
Jehan [Wed, 15 Apr 2020 11:01:09 +0000 (13:01 +0200)]
CMakeLists: do not enforce strict prototypes on Windows.

On Windows, or at least when cross-built with Mingw-w64, build fails
because strict prototype fails on an included file (thus nothing we can
do about in json-c code):

> from /home/jehan/dev/src/json-c/json_util.c:44:
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/minwindef.h:196:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
>   196 |   typedef INT_PTR (WINAPI *FARPROC) ();
>       |   ^~~~~~~
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/minwindef.h:197:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
>   197 |   typedef INT_PTR (WINAPI *NEARPROC) ();
>       |   ^~~~~~~
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/minwindef.h:198:3: error: function declaration isn't a prototype [-Werror=strict-prototypes]
>   198 |   typedef INT_PTR (WINAPI *PROC) ();
>       |   ^~~~~~~

Let's just disable the errors for Windows build.

4 years agoMerge pull request #580 from besser82/topic/besser82/fix_cmake_tests
Eric Haszlakiewicz [Tue, 14 Apr 2020 19:17:21 +0000 (15:17 -0400)]
Merge pull request #580 from besser82/topic/besser82/fix_cmake_tests

Fix CMake tests for enforced strict prototypes.

4 years agoFix CMake tests for enforced strict prototypes.
Björn Esser [Tue, 14 Apr 2020 18:42:32 +0000 (20:42 +0200)]
Fix CMake tests for enforced strict prototypes.

4 years agoMerge pull request #527 from dota17/arraylist_test
Eric Haszlakiewicz [Tue, 14 Apr 2020 14:28:16 +0000 (10:28 -0400)]
Merge pull request #527 from dota17/arraylist_test

Arraylist testcase

4 years agoMerge pull request #579 from besser82/topic/besser82/strict-prototypes
Eric Haszlakiewicz [Tue, 14 Apr 2020 14:25:13 +0000 (10:25 -0400)]
Merge pull request #579 from besser82/topic/besser82/strict-prototypes

Enforce strict prototypes.

4 years agoclang-format two test_util_file.c and test_object_iterator.c
dota17 [Tue, 14 Apr 2020 02:15:27 +0000 (10:15 +0800)]
clang-format two test_util_file.c and test_object_iterator.c

4 years agoIncreased the test coverage of json_util.c from 76% to 90.3%.
chenguoping [Fri, 3 Jan 2020 02:17:05 +0000 (10:17 +0800)]
Increased the test coverage of json_util.c from 76% to 90.3%.

4 years agoIncreased the test coverage of json_object_iterator.c from 0% to 100%
chenguoping [Fri, 3 Jan 2020 02:05:09 +0000 (10:05 +0800)]
Increased the test coverage of json_object_iterator.c from 0% to 100%

4 years agoclang-format test1.c
dota17 [Tue, 14 Apr 2020 01:20:51 +0000 (09:20 +0800)]
clang-format test1.c

4 years agofix valgrind errors
chenguoping [Fri, 3 Jan 2020 08:56:43 +0000 (16:56 +0800)]
fix valgrind errors

4 years agotestcase for array_list
chenguoping [Thu, 2 Jan 2020 11:30:00 +0000 (19:30 +0800)]
testcase for array_list

4 years agoEnforce strict prototypes.
Björn Esser [Mon, 13 Apr 2020 09:29:52 +0000 (11:29 +0200)]
Enforce strict prototypes.

4 years agoMerge pull request #578 from besser82/topic/besser82/pkgconfig_install
Eric Haszlakiewicz [Mon, 13 Apr 2020 00:52:01 +0000 (20:52 -0400)]
Merge pull request #578 from besser82/topic/besser82/pkgconfig_install

CMake: Install pkgconfig file in proper location by default

4 years agoCMake: Install pkgconfig file in proper location by default
Björn Esser [Sun, 12 Apr 2020 17:21:54 +0000 (19:21 +0200)]
CMake: Install pkgconfig file in proper location by default

The default location for pkconfig files on most systems is:
  ${CMAKE_INSTALL_LIBDIR}/pkgconfig

Thus the file should get installed in there by default.

4 years agoMerge pull request #577 from besser82/topic/besser82/json_c_version_test_verbose_on_fail
Eric Haszlakiewicz [Sun, 12 Apr 2020 02:35:40 +0000 (22:35 -0400)]
Merge pull request #577 from besser82/topic/besser82/json_c_version_test_verbose_on_fail

Be verbose on failing json_c_version test.

4 years agoBe verbose on failing json_c_version test.
Björn Esser [Sat, 11 Apr 2020 19:09:31 +0000 (21:09 +0200)]
Be verbose on failing json_c_version test.

4 years agoMerge pull request #576 from besser82/topic/besser82/increase_coverage
Eric Haszlakiewicz [Sat, 11 Apr 2020 18:45:45 +0000 (14:45 -0400)]
Merge pull request #576 from besser82/topic/besser82/increase_coverage

Test coverage for json_c_version.

4 years agoMerge pull request #575 from besser82/topic/besser82/cosmetics
Eric Haszlakiewicz [Sat, 11 Apr 2020 18:18:37 +0000 (14:18 -0400)]
Merge pull request #575 from besser82/topic/besser82/cosmetics

Small cosmetics.

4 years agoTest coverage for json_c_version.
Björn Esser [Sat, 11 Apr 2020 10:29:36 +0000 (12:29 +0200)]
Test coverage for json_c_version.

4 years agoRemove multiple trailing newlines at EOF.
Björn Esser [Sat, 11 Apr 2020 08:34:30 +0000 (10:34 +0200)]
Remove multiple trailing newlines at EOF.

4 years agogitignore: Add build folder.
Björn Esser [Fri, 10 Apr 2020 11:10:30 +0000 (13:10 +0200)]
gitignore: Add build folder.

4 years agoClean trailing white-space.
Björn Esser [Fri, 10 Apr 2020 11:06:54 +0000 (13:06 +0200)]
Clean trailing white-space.

4 years agoFix line terminators to be UNIX.
Björn Esser [Fri, 10 Apr 2020 11:25:41 +0000 (13:25 +0200)]
Fix line terminators to be UNIX.

4 years agoUpdate README.md to remove autoconf instructions in favor of cmake.
Eric Haszlakiewicz [Sat, 11 Apr 2020 03:24:51 +0000 (03:24 +0000)]
Update README.md to remove autoconf instructions in favor of cmake.

4 years agoMerge pull request #572 from besser82/topic/besser82/cmake_fixes
Eric Haszlakiewicz [Sat, 11 Apr 2020 02:08:27 +0000 (22:08 -0400)]
Merge pull request #572 from besser82/topic/besser82/cmake_fixes

Small fixes to CMakeLists

4 years agoMerge pull request #573 from besser82/topic/besser82/coverage
Chen [Sat, 11 Apr 2020 01:31:43 +0000 (09:31 +0800)]
Merge pull request #573 from besser82/topic/besser82/coverage

Fix coveralls submission.

4 years agoFix coveralls submission.
Björn Esser [Fri, 10 Apr 2020 13:08:09 +0000 (15:08 +0200)]
Fix coveralls submission.

coveralls-cpp is dead and does not work anymore.
Fortunately there is coveralls-lcov available.

4 years agoCMake: Check whether BSYMBOLIC is supported by the linker.
Björn Esser [Fri, 10 Apr 2020 12:42:03 +0000 (14:42 +0200)]
CMake: Check whether BSYMBOLIC is supported by the linker.

Linking with '-Bsymbolic-functions' is supported for ELF-binaries, only.

4 years agoCMake: Build Doxygen documentation out-of-tree.
Björn Esser [Fri, 10 Apr 2020 12:20:57 +0000 (14:20 +0200)]
CMake: Build Doxygen documentation out-of-tree.

4 years agoCMake: Fix appending of linker flags.
Björn Esser [Fri, 10 Apr 2020 12:15:52 +0000 (14:15 +0200)]
CMake: Fix appending of linker flags.

There was a typo in `CMAKE_SHARED_LINKER_FLAGS`.

4 years agoList the set of contributors since the 0.13 branch
Eric Haszlakiewicz [Fri, 10 Apr 2020 02:11:48 +0000 (02:11 +0000)]
List the set of contributors since the 0.13 branch

4 years agoFix one more assert("!invalid cint_type") to use json_abort(...) instead.
Eric Haszlakiewicz [Fri, 10 Apr 2020 01:26:04 +0000 (01:26 +0000)]
Fix one more assert("!invalid cint_type") to use json_abort(...) instead.

4 years agoIssue #568: fix the strtoll and strtoull handing so config.h ends up creating defines...
Eric Haszlakiewicz [Thu, 9 Apr 2020 20:58:28 +0000 (20:58 +0000)]
Issue #568: fix the strtoll and strtoull handing so config.h ends up creating defines for those only when needed, which should exclude mingw environments.

4 years agoRemove autoconf files from .gitignore.
Eric Haszlakiewicz [Thu, 9 Apr 2020 02:55:21 +0000 (02:55 +0000)]
Remove autoconf files from .gitignore.

4 years agoUpdate the oss-fuzz build script to try to get it to work with cmake.
Eric Haszlakiewicz [Thu, 9 Apr 2020 02:34:59 +0000 (02:34 +0000)]
Update the oss-fuzz build script to try to get it to work with cmake.

4 years agoRemove autoconf machinery, we're using cmake now. Update the release checklist to...
Eric Haszlakiewicz [Thu, 9 Apr 2020 02:15:31 +0000 (02:15 +0000)]
Remove autoconf machinery, we're using cmake now.  Update the release checklist to account for that, plus fill in other tasks and clean it up a bit.

4 years agoosx builds also need -DDISABLE_BSYMBOLIC=ON
Eric Haszlakiewicz [Wed, 8 Apr 2020 03:04:27 +0000 (03:04 +0000)]
osx builds also need -DDISABLE_BSYMBOLIC=ON

4 years agoI have NFC why osx fails when "set -e" is in effect, but leave it off and clean up...
Eric Haszlakiewicz [Wed, 8 Apr 2020 02:54:10 +0000 (02:54 +0000)]
I have NFC why osx fails when "set -e" is in effect, but leave it off and clean up the rest of the debuging code in the travis config.

4 years agoNot all systems (e.g. osx) have malloc.h, include stdlib.h instead.
Eric Haszlakiewicz [Wed, 8 Apr 2020 02:53:48 +0000 (02:53 +0000)]
Not all systems (e.g. osx) have malloc.h, include stdlib.h instead.

4 years agoTry yet again to fix the osx build, this time do set +e
Eric Haszlakiewicz [Wed, 8 Apr 2020 02:39:03 +0000 (02:39 +0000)]
Try yet again to fix the osx build, this time do set +e

4 years agoAnother attempt at debugging the travis osx build, this time just ignore errors.
Eric Haszlakiewicz [Wed, 8 Apr 2020 02:28:02 +0000 (02:28 +0000)]
Another attempt at debugging the travis osx build, this time just ignore errors.

4 years agoWait a while before exiting travis to allow output to flush.
Eric Haszlakiewicz [Wed, 8 Apr 2020 02:17:14 +0000 (02:17 +0000)]
Wait a while before exiting travis to allow output to flush.

4 years agoApparently cmake is already installed on travis osx builds. Try another approach...
Eric Haszlakiewicz [Wed, 8 Apr 2020 02:02:25 +0000 (02:02 +0000)]
Apparently cmake is already installed on travis osx builds.  Try another approach to figure out what was failing.

4 years agoInstall cmake on osx travis builds. s/make check/make test/
Eric Haszlakiewicz [Wed, 8 Apr 2020 01:45:49 +0000 (01:45 +0000)]
Install cmake on osx travis builds.  s/make check/make test/

4 years agoPerform the travis build in a subdir, so the distcheck target works.
Eric Haszlakiewicz [Wed, 8 Apr 2020 01:34:22 +0000 (01:34 +0000)]
Perform the travis build in a subdir, so the distcheck target works.

4 years agoSwitch travis to use cmake instead of autoconf.
Eric Haszlakiewicz [Wed, 8 Apr 2020 01:21:11 +0000 (01:21 +0000)]
Switch travis to use cmake instead of autoconf.

4 years agoAdd includes and split off json_types.h to help ensure that headers can be included...
Eric Haszlakiewicz [Mon, 6 Apr 2020 13:55:27 +0000 (13:55 +0000)]
Add includes and split off json_types.h to help ensure that headers can be included in any order.

4 years agoDon't let clang-format rearrange Windows includes, since they need to be in a particu...
Eric Haszlakiewicz [Mon, 6 Apr 2020 02:47:34 +0000 (02:47 +0000)]
Don't let clang-format rearrange Windows includes, since they need to be in a particular order.

4 years agoFormat random_seed.c with clang-format, with key asm sections excluded.
Eric Haszlakiewicz [Mon, 6 Apr 2020 01:52:28 +0000 (01:52 +0000)]
Format random_seed.c with clang-format, with key asm sections excluded.

4 years agoUpdate the style guide to mention that we're using clang-format now.
Eric Haszlakiewicz [Mon, 6 Apr 2020 01:49:14 +0000 (01:49 +0000)]
Update the style guide to mention that we're using clang-format now.

4 years agoMerge pull request #555 from dota17/chang_format_3
Eric Haszlakiewicz [Fri, 3 Apr 2020 04:13:34 +0000 (00:13 -0400)]
Merge pull request #555 from dota17/chang_format_3

Format json-c with clang-format tool

4 years agoclang-format the files
dota17 [Sat, 28 Mar 2020 02:25:00 +0000 (10:25 +0800)]
clang-format the files

4 years agoadd the disabling formatting coments and adjust the partial code manuly
dota17 [Fri, 27 Mar 2020 05:04:50 +0000 (13:04 +0800)]
add the disabling formatting coments and adjust the partial code manuly

4 years agoadd options
dota17 [Tue, 10 Mar 2020 07:47:53 +0000 (15:47 +0800)]
add options

4 years agoclang-format
dota17 [Fri, 6 Mar 2020 09:15:05 +0000 (17:15 +0800)]
clang-format

4 years agoMerge pull request #563 from robybeen/master
Eric Haszlakiewicz [Fri, 3 Apr 2020 02:35:21 +0000 (22:35 -0400)]
Merge pull request #563 from robybeen/master

Changed order of calloc args to match stdlib

4 years agoChanged order of calloc args to match stdlib (2)
Robert [Thu, 2 Apr 2020 17:28:55 +0000 (19:28 +0200)]
Changed order of calloc args to match stdlib (2)

Although it is currently working, it's worth to stick with the stdlib definition to avoid further problems

4 years agoChanged order of calloc args to match stdlib
Robert [Thu, 2 Apr 2020 17:23:10 +0000 (19:23 +0200)]
Changed order of calloc args to match stdlib

Although it is currently working, it's worth to stick with the stdlib definition to avoid further problems

4 years agoMerge pull request #562 from dota17/testcase_add
Eric Haszlakiewicz [Thu, 2 Apr 2020 15:23:39 +0000 (11:23 -0400)]
Merge pull request #562 from dota17/testcase_add

Bugfix and testcases supplements

4 years agoadd test cases
dota17 [Mon, 30 Mar 2020 09:32:06 +0000 (17:32 +0800)]
add test cases

4 years agoMerge pull request #561 from dota17/add_badge
Chen [Tue, 31 Mar 2020 02:54:45 +0000 (10:54 +0800)]
Merge pull request #561 from dota17/add_badge

add the badge in README.md and test the coveralls

4 years agoadd the badge in README.md and test the coveralls
dota17 [Mon, 30 Mar 2020 07:43:50 +0000 (15:43 +0800)]
add the badge in README.md and test the coveralls

4 years agoMerge pull request #541 from dota17/coveralls_final
Chen [Sat, 28 Mar 2020 02:42:17 +0000 (10:42 +0800)]
Merge pull request #541 from dota17/coveralls_final

add coveralls auto tool to json-c

4 years agomodify the coveralls configuration file
dota17 [Wed, 19 Feb 2020 10:13:28 +0000 (18:13 +0800)]
modify the coveralls configuration file

4 years agoMerge pull request #558 from dota17/doc_message_modify
Chen [Fri, 20 Mar 2020 03:17:20 +0000 (11:17 +0800)]
Merge pull request #558 from dota17/doc_message_modify

modify the doc target message

4 years agomodify the doc target message
dota17 [Thu, 19 Mar 2020 02:23:29 +0000 (10:23 +0800)]
modify the doc target message

4 years agoMerge pull request #556 from Jehan/wip/Jehan/fix-broken-mingw-w64
Eric Haszlakiewicz [Tue, 17 Mar 2020 02:24:14 +0000 (21:24 -0500)]
Merge pull request #556 from Jehan/wip/Jehan/fix-broken-mingw-w64

Fixes various Wreturn-type and Wimplicit-fallthrough errors on Mingw-w64

4 years agoFixes various Wreturn-type and Wimplicit-fallthrough errors on Mingw-w64
Jehan [Sun, 15 Mar 2020 22:29:37 +0000 (23:29 +0100)]
Fixes various Wreturn-type and Wimplicit-fallthrough errors on Mingw-w64

This is a recent regression since commit
6359b798479d379a3202e02c6a938d9b40c0d856 which added various assert(0)
calls (often replacing return-s).
With Ming-W64 compiler, json-c build was failing with various errors of
the sort:

> /home/jehan/dev/src/json-c/json_object.c: In function 'json_object_int_inc':
> /home/jehan/dev/src/json-c/json_object.c:841:1: error: control reaches end of non-void function [-Werror=return-type]
>   841 | }
>       | ^
> In file included from /home/jehan/dev/src/json-c/json_object.c:17:
> /home/jehan/dev/src/json-c/json_object.c: In function 'json_object_get_double':
> /home/jehan/.local/share/crossroad/roads/w64/json-c/include/assert.h:76:4: error: this statement may fall through [-Werror=implicit-fallthrough=]
>    76 |   (_assert(#_Expression,__FILE__,__LINE__),0))
>       |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> /home/jehan/dev/src/json-c/json_object.c:1070:7: note: in expansion of macro 'assert'
>  1070 |       assert(0);
>       |       ^~~~~~
> /home/jehan/dev/src/json-c/json_object.c:1072:3: note: here
>  1072 |   case json_type_boolean:
>       |   ^~~~

The problem is that Mingw-w64 does not consider assert() as a noreturn
(even assert(0)), because it has to be compatible by Microsoft
libraries. See the discussion here:
https://sourceforge.net/p/mingw-w64/bugs/306/

Instead let's create a new json_abort() function which is basically just
an abort() function with an optional message, for such cases where
abortion was non-conditional (using assert() and using the assertion
condition as a message here was clearly a misuse of the function). And
mark json_abort() as 'noreturn', as well as 'cold' for optimization
purpose (this is code we expect to never run, unless there is a bug,
that is).

Finally let's use this json_abort() instead of previous misused assert()
calls.

4 years agoMerge pull request #546 from dota17/make_unistall
Eric Haszlakiewicz [Wed, 11 Mar 2020 03:12:13 +0000 (22:12 -0500)]
Merge pull request #546 from dota17/make_unistall

Add uninstall target in cmake

4 years agodelete -r in uninstall
dota17 [Wed, 11 Mar 2020 02:47:04 +0000 (10:47 +0800)]
delete -r in uninstall

4 years agoMerge pull request #547 from dota17/assert_test
Eric Haszlakiewicz [Tue, 3 Mar 2020 13:54:21 +0000 (07:54 -0600)]
Merge pull request #547 from dota17/assert_test

modify json-c default build type, and fix up the assert() errors in t…