| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
json_parse_int64(). Document that overflow/underflow for these functions is not an error, but sets errno=ERANGE.
|
|
|
|
|
|
| |
and "12.3E12E12", while still allowing "0e+" in non-strict mode.
Deprecate the json_parse_double() function from json_util.h
|
|
|
|
|
| |
introduced in #542
fixes #601
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
be specified.
|
|
|
|
| |
Windows.
|
|
|
|
| |
that they return NULL on failures.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
json_util_get_last_err() function to retrieve the error for those callers that care about it.
Add tests and descriptions for the functions in json_util.c
|
|
|
|
|
|
|
| |
Also refactor json_object_from_file to use json_object_from_fd
internally.
Signed-off-by: Michael Heimpold <mhei@heimpold.de>
|
|
|
|
|
|
| |
else in bits.h deprecated.
Eliminate all uses of bits.h within the json-c code.
|
|
|
|
|
| |
filename should be passed as const char* to functions
json_object_to_file and json_object_to_file
|
| |
|
|
|
|
|
|
|
|
|
| |
output to be selected.
There are now three options: JSON_C_TO_STRING_SPACED, JSON_C_TO_STRING_PLAIN and JSON_C_TO_STRING_PRETTY.
This also add a json_object_to_file_ext() that takes the same flags.
Existing output of json_object_to_json_string() is unchanged, and uses JSON_C_TO_STRING_SPACED.
Thanks fo Grant Edwards for the initial patches.
|
|
|
|
|
|
| |
type. Useful for logging.
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@67 327403b1-1117-474d-bef2-5cb71233fd97
|
|
|
|
|
|
|
|
|
|
| |
json_object_get_int64. Binary compatibility preserved.
Eric Haszlakiewicz, EHASZLA at transunion com
Rui Miguel Silva Seabra, rms at 1407 dot org
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@56 327403b1-1117-474d-bef2-5cb71233fd97
|
|
|
|
|
|
|
| |
Spotted by Vikram Raj V, vsagar at attinteractive dot com
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@55 327403b1-1117-474d-bef2-5cb71233fd97
|
|
|
|
|
|
|
|
|
|
| |
* Add casts from void* to type of assignment when using malloc
* Add #ifdef __cplusplus guards to all of the headers
* Add typedefs for json_object, json_tokener, array_list, printbuf, lh_table
Michael Clark, <michael@metaparadigm.com>
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@33 327403b1-1117-474d-bef2-5cb71233fd97
|
|
|
|
| |
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@29 327403b1-1117-474d-bef2-5cb71233fd97
|
|
|
|
|
|
|
|
|
|
| |
Johan Bj�rklund, johbjo09 at kth dot se
* Remove include "config.h" from headers (should only
be included from .c files)
Michael Clark <michael@metaparadigm.com>
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@12 327403b1-1117-474d-bef2-5cb71233fd97
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Add ifdef C++ extern "C" to headers
* Use simpler definition of min and max in bits.h
Larry Lansing, llansing at fuzzynerd dot com
* Remove automake 1.6 requirement
* Move autogen commands into autogen.sh. Update README
* Remove error pointer special case for Windows
* Change license from LGPL to MIT
Michael Clark <michael@metaparadigm.com>
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@10 327403b1-1117-474d-bef2-5cb71233fd97
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added a Win32/Win64 compliant implementation of vasprintf
* debug.c - C. Watford (christopher dot watford at gmail dot com)
Removed usage of vsyslog on Win32/Win64 systems, needs to be handled
by a configure script
* json_object.c - C. Watford (christopher dot watford at gmail dot com)
Added scope operator to wrap usage of json_object_object_foreach, this
needs to be rethought to be more ANSI C friendly
* json_object.h - C. Watford (christopher dot watford at gmail dot com)
Added Microsoft C friendly version of json_object_object_foreach
* json_tokener.c - C. Watford (christopher dot watford at gmail dot com)
Added a Win32/Win64 compliant implementation of strndup
* json_util.c - C. Watford (christopher dot watford at gmail dot com)
Added cast and mask to suffice size_t v. unsigned int conversion
correctness
* json_tokener.c - sign reversal issue on error info for nested object parse
spotted by Johan Bj�rklund (johbjo09 at kth.se)
* json_object.c - escape " in json_escape_str
* Change to automake and libtool to build shared and static library
Michael Clark <michael@metaparadigm.com>
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@4 327403b1-1117-474d-bef2-5cb71233fd97
|
|
git-svn-id: http://svn.metaparadigm.com/svn/json-c/trunk@2 327403b1-1117-474d-bef2-5cb71233fd97
|