From bf7a73fa652561b302e857ab21a6c6bbc68e661c Mon Sep 17 00:00:00 2001 From: No Default Name Date: Tue, 24 May 2022 21:42:03 +0200 Subject: [PATCH] README.md: add compile details when using long long type --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f1808c..c20ac4d 100644 --- a/README.md +++ b/README.md @@ -555,7 +555,13 @@ While the JSON standard only specifies floating point numbers, cJSON also suppor cJSON number items can be accessed using either the floating point or the integer function calls. Especially **writing** to the `valuedouble` or `valueint` members is deprecated, since writing to either one will not update the other, and will not update the integer representation flag. -The integer type defaults to `int`, and can be switched to `long long` by defining `CJSON_INT_USE_LONGLONG` in `cJSON.h`. +The integer type defaults to `int`, and can be switched to `long long` by defining `CJSON_INT_USE_LONGLONG` in `cJSON.h`. Since `long long` is not a C89 data type, a default cmake compile will fail. Either remove `-std=c89` from `CMakeLists.txt`, or force compiler flags e.g.: + +``` +mkdir build +cd build +CFLAGS="-Wall -Werror" cmake -DENABLE_CUSTOM_COMPILER_FLAGS=Off .. +``` #### Deep Nesting Of Arrays And Objects