From caf540ccdb98e8f96a6f557075cb607288384938 Mon Sep 17 00:00:00 2001 From: Archit Gupta <71798289+archigup@users.noreply.github.com> Date: Fri, 23 Jul 2021 08:38:26 -0700 Subject: [PATCH] Release cleanup (#104) Updates version numbers, README.md documentation links, and adds C++ guards in core_json.h. --- .github/workflows/ci.yml | 2 +- .github/workflows/memory_statistics.yml | 2 +- CHANGELOG.md | 5 +++++ README.md | 16 ++++++++++++++-- docs/doxygen/config.doxyfile | 2 +- .../include/{size_table.html => size_table.md} | 0 docs/doxygen/pages.dox | 2 +- lexicon.txt | 1 + manifest.yml | 2 +- source/core_json.c | 2 +- source/include/core_json.h | 15 ++++++++++++++- test/cbmc/include/core_json_annex.h | 2 +- test/cbmc/include/skipGeneric.h | 2 +- .../proofs/JSON_Iterate/JSON_Iterate_harness.c | 2 +- .../proofs/JSON_Search/JSON_Search_harness.c | 2 +- .../proofs/JSON_Validate/JSON_Validate_harness.c | 2 +- .../skipAnyLiteral/skipAnyLiteral_harness.c | 2 +- .../skipCollection/skipCollection_harness.c | 2 +- test/cbmc/proofs/skipEscape/skipEscape_harness.c | 2 +- test/cbmc/proofs/skipNumber/skipNumber_harness.c | 2 +- test/cbmc/proofs/skipSpace/skipSpace_harness.c | 2 +- .../skipSpaceAndComma_harness.c | 2 +- test/cbmc/proofs/skipString/skipString_harness.c | 2 +- test/cbmc/proofs/skipUTF8/skipUTF8_harness.c | 2 +- test/cbmc/stubs/skipAnyLiteral.c | 2 +- test/cbmc/stubs/skipAnyScalar.c | 2 +- test/cbmc/stubs/skipCollection.c | 2 +- test/cbmc/stubs/skipEscape.c | 2 +- test/cbmc/stubs/skipGeneric.c | 2 +- test/cbmc/stubs/skipNumber.c | 2 +- test/cbmc/stubs/skipSpace.c | 2 +- test/cbmc/stubs/skipSpaceAndComma.c | 2 +- test/cbmc/stubs/skipString.c | 2 +- test/cbmc/stubs/skipUTF8.c | 2 +- test/unit-test/core_json_utest.c | 2 +- 35 files changed, 64 insertions(+), 33 deletions(-) rename docs/doxygen/include/{size_table.html => size_table.md} (100%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f731ff43..a8b6f47c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,4 +113,4 @@ jobs: uses: FreeRTOS/CI-CD-Github-Actions/memory_statistics@main with: config: .github/memory_statistics_config.json - check_against: docs/doxygen/include/size_table.html + check_against: docs/doxygen/include/size_table.md diff --git a/.github/workflows/memory_statistics.yml b/.github/workflows/memory_statistics.yml index 499d205b..9c778c76 100644 --- a/.github/workflows/memory_statistics.yml +++ b/.github/workflows/memory_statistics.yml @@ -19,4 +19,4 @@ jobs: uses: actions/upload-artifact@v2 with: name: size_table - path: size_table.html + path: size_table.md diff --git a/CHANGELOG.md b/CHANGELOG.md index c95e839b..17616631 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log for coreJSON Library +## v3.0.2 (July 2021) +- [#100](https://github.com/FreeRTOS/coreJSON/pull/100) Fix overflow in skipOneHexEscape(). +- [#95](https://github.com/FreeRTOS/coreJSON/pull/95) Eliminate warnings when base char type is unsigned. +- [#93](https://github.com/FreeRTOS/coreJSON/pull/93) Wrap query key separator macro with ifndef. + ## v3.0.1 (February 2021) - [#86](https://github.com/FreeRTOS/coreJSON/pull/86) Fix MISRA 9.1 violation. - [#84](https://github.com/FreeRTOS/coreJSON/pull/84), [#82](https://github.com/FreeRTOS/coreJSON/pull/82) and [#80](https://github.com/FreeRTOS/coreJSON/pull/80) Documentation updates and fixes. diff --git a/README.md b/README.md index 49d82b7d..5e4c488e 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This repository contains the coreJSON library, a parser that strictly enforces t This library has gone through code quality checks including verification that no function has a [GNU Complexity](https://www.gnu.org/software/complexity/manual/complexity.html) score over 8, and checks against deviations from mandatory rules in the [MISRA coding standard](https://www.misra.org.uk). Deviations from the MISRA C:2012 guidelines are documented under [MISRA Deviations](MISRA.md). This library has also undergone both static code analysis from [Coverity static analysis](https://scan.coverity.com/), and validation of memory safety through the [CBMC automated reasoning tool](https://www.cprover.org/cbmc/). -See memory requirements for this library [here](https://docs.aws.amazon.com/embedded-csdk/202103.00/lib-ref/libraries/standard/coreJSON/docs/doxygen/output/html/index.html#json_memory_requirements). +See memory requirements for this library [here](./docs/doxygen/include/size_table.md). **coreJSON v3.0.0 [source code](https://github.com/FreeRTOS/coreJSON/tree/v3.0.0/source) is part of the [FreeRTOS 202012.00 LTS](https://github.com/FreeRTOS/FreeRTOS-LTS/tree/202012.00-LTS) release.** @@ -68,7 +68,19 @@ gcc -I source/include example.c source/core_json.c -o example gcc -I source/include -c source/core_json.c ``` -## Generating documentation +## Documentation + +### Existing documentation +For pre-generated documentation, please see the documentation linked in the locations below: + +| Location | +| :-: | +| [AWS IoT Device SDK for Embedded C](https://github.com/aws/aws-iot-device-sdk-embedded-C#releases-and-documentation) | +| [FreeRTOS.org](https://freertos.org/Documentation/api-ref/coreJSON/docs/doxygen/output/html/index.html) | + +Note that the latest included version of the coreJSON library may differ across repositories. + +### Generating documentation The Doxygen references were created using Doxygen version 1.8.20. To generate the Doxygen pages, please run the following command from the root of this repository: diff --git a/docs/doxygen/config.doxyfile b/docs/doxygen/config.doxyfile index 4f9bf052..11b6e600 100644 --- a/docs/doxygen/config.doxyfile +++ b/docs/doxygen/config.doxyfile @@ -38,7 +38,7 @@ PROJECT_NAME = "coreJSON" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = "v3.0.1" +PROJECT_NUMBER = "v3.0.2" # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/docs/doxygen/include/size_table.html b/docs/doxygen/include/size_table.md similarity index 100% rename from docs/doxygen/include/size_table.html rename to docs/doxygen/include/size_table.md diff --git a/docs/doxygen/pages.dox b/docs/doxygen/pages.dox index 66fa0d40..a1d08777 100644 --- a/docs/doxygen/pages.dox +++ b/docs/doxygen/pages.dox @@ -12,7 +12,7 @@ and no heap allocation, making it suitable for IoT microcontrollers, but also fu @section json_memory_requirements Memory Requirements @brief Memory requirements of the JSON library. -@include{doc} size_table.html +@include{doc} size_table.md @section json_design Design @brief JSON Library Design diff --git a/lexicon.txt b/lexicon.txt index c6965041..d4b0972b 100644 --- a/lexicon.txt +++ b/lexicon.txt @@ -64,6 +64,7 @@ keylength len longjmp mainpage +md microcontrollers min misra diff --git a/manifest.yml b/manifest.yml index 35647efb..c91c873f 100644 --- a/manifest.yml +++ b/manifest.yml @@ -1,5 +1,5 @@ name : "coreJSON" -version: "v3.0.1" +version: "v3.0.2" description: | "A parser strictly enforcing the ECMA-404 JSON standard, suitable for microcontrollers. \n" license: "MIT" diff --git a/source/core_json.c b/source/core_json.c index 6007749e..a9c81772 100644 --- a/source/core_json.c +++ b/source/core_json.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/source/include/core_json.h b/source/include/core_json.h index c71eb5ec..16997b21 100644 --- a/source/include/core_json.h +++ b/source/include/core_json.h @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of @@ -31,6 +31,12 @@ #include #include +/* *INDENT-OFF* */ +#ifdef __cplusplus + extern "C" { +#endif +/* *INDENT-ON* */ + /** * @ingroup json_enum_types * @brief Return codes from coreJSON library functions. @@ -321,4 +327,11 @@ JSONStatus_t JSON_Iterate( const char * buf, size_t * next, JSONPair_t * outPair ); /* @[declare_json_iterate] */ + +/* *INDENT-OFF* */ +#ifdef __cplusplus + } +#endif +/* *INDENT-ON* */ + #endif /* ifndef CORE_JSON_H_ */ diff --git a/test/cbmc/include/core_json_annex.h b/test/cbmc/include/core_json_annex.h index 1d5ea6c0..9e03d9ec 100644 --- a/test/cbmc/include/core_json_annex.h +++ b/test/cbmc/include/core_json_annex.h @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/include/skipGeneric.h b/test/cbmc/include/skipGeneric.h index 759279d6..03b1b558 100644 --- a/test/cbmc/include/skipGeneric.h +++ b/test/cbmc/include/skipGeneric.h @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/JSON_Iterate/JSON_Iterate_harness.c b/test/cbmc/proofs/JSON_Iterate/JSON_Iterate_harness.c index 155c544f..00dd7113 100644 --- a/test/cbmc/proofs/JSON_Iterate/JSON_Iterate_harness.c +++ b/test/cbmc/proofs/JSON_Iterate/JSON_Iterate_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/JSON_Search/JSON_Search_harness.c b/test/cbmc/proofs/JSON_Search/JSON_Search_harness.c index c4b6e045..4ad094ad 100644 --- a/test/cbmc/proofs/JSON_Search/JSON_Search_harness.c +++ b/test/cbmc/proofs/JSON_Search/JSON_Search_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/JSON_Validate/JSON_Validate_harness.c b/test/cbmc/proofs/JSON_Validate/JSON_Validate_harness.c index 948dbbb9..a3cb0869 100644 --- a/test/cbmc/proofs/JSON_Validate/JSON_Validate_harness.c +++ b/test/cbmc/proofs/JSON_Validate/JSON_Validate_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipAnyLiteral/skipAnyLiteral_harness.c b/test/cbmc/proofs/skipAnyLiteral/skipAnyLiteral_harness.c index 79ef9ebc..d474d2c8 100644 --- a/test/cbmc/proofs/skipAnyLiteral/skipAnyLiteral_harness.c +++ b/test/cbmc/proofs/skipAnyLiteral/skipAnyLiteral_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipCollection/skipCollection_harness.c b/test/cbmc/proofs/skipCollection/skipCollection_harness.c index 03b99f98..5c3241c7 100644 --- a/test/cbmc/proofs/skipCollection/skipCollection_harness.c +++ b/test/cbmc/proofs/skipCollection/skipCollection_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipEscape/skipEscape_harness.c b/test/cbmc/proofs/skipEscape/skipEscape_harness.c index f7d831f9..e22abe1e 100644 --- a/test/cbmc/proofs/skipEscape/skipEscape_harness.c +++ b/test/cbmc/proofs/skipEscape/skipEscape_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipNumber/skipNumber_harness.c b/test/cbmc/proofs/skipNumber/skipNumber_harness.c index 45e5b213..4440c49b 100644 --- a/test/cbmc/proofs/skipNumber/skipNumber_harness.c +++ b/test/cbmc/proofs/skipNumber/skipNumber_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipSpace/skipSpace_harness.c b/test/cbmc/proofs/skipSpace/skipSpace_harness.c index 7bca1e1d..cbd89a02 100644 --- a/test/cbmc/proofs/skipSpace/skipSpace_harness.c +++ b/test/cbmc/proofs/skipSpace/skipSpace_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipSpaceAndComma/skipSpaceAndComma_harness.c b/test/cbmc/proofs/skipSpaceAndComma/skipSpaceAndComma_harness.c index 5a2fff45..e25d4f8b 100644 --- a/test/cbmc/proofs/skipSpaceAndComma/skipSpaceAndComma_harness.c +++ b/test/cbmc/proofs/skipSpaceAndComma/skipSpaceAndComma_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipString/skipString_harness.c b/test/cbmc/proofs/skipString/skipString_harness.c index e8d09f83..870cffda 100644 --- a/test/cbmc/proofs/skipString/skipString_harness.c +++ b/test/cbmc/proofs/skipString/skipString_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/proofs/skipUTF8/skipUTF8_harness.c b/test/cbmc/proofs/skipUTF8/skipUTF8_harness.c index 6a9c897d..1affa457 100644 --- a/test/cbmc/proofs/skipUTF8/skipUTF8_harness.c +++ b/test/cbmc/proofs/skipUTF8/skipUTF8_harness.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipAnyLiteral.c b/test/cbmc/stubs/skipAnyLiteral.c index fae9584d..1f2d2a02 100644 --- a/test/cbmc/stubs/skipAnyLiteral.c +++ b/test/cbmc/stubs/skipAnyLiteral.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipAnyScalar.c b/test/cbmc/stubs/skipAnyScalar.c index 87a6ab32..cffa9aed 100644 --- a/test/cbmc/stubs/skipAnyScalar.c +++ b/test/cbmc/stubs/skipAnyScalar.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipCollection.c b/test/cbmc/stubs/skipCollection.c index 7387b673..012c789d 100644 --- a/test/cbmc/stubs/skipCollection.c +++ b/test/cbmc/stubs/skipCollection.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipEscape.c b/test/cbmc/stubs/skipEscape.c index 03d0fdbd..8d7c7c08 100644 --- a/test/cbmc/stubs/skipEscape.c +++ b/test/cbmc/stubs/skipEscape.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipGeneric.c b/test/cbmc/stubs/skipGeneric.c index 29a91ce6..d59fe8a5 100644 --- a/test/cbmc/stubs/skipGeneric.c +++ b/test/cbmc/stubs/skipGeneric.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipNumber.c b/test/cbmc/stubs/skipNumber.c index be76bc94..c96d64a7 100644 --- a/test/cbmc/stubs/skipNumber.c +++ b/test/cbmc/stubs/skipNumber.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipSpace.c b/test/cbmc/stubs/skipSpace.c index b5cfcb49..29c0a625 100644 --- a/test/cbmc/stubs/skipSpace.c +++ b/test/cbmc/stubs/skipSpace.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipSpaceAndComma.c b/test/cbmc/stubs/skipSpaceAndComma.c index 8cab0cf0..b0ca5842 100644 --- a/test/cbmc/stubs/skipSpaceAndComma.c +++ b/test/cbmc/stubs/skipSpaceAndComma.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipString.c b/test/cbmc/stubs/skipString.c index 1e0efda1..27998cca 100644 --- a/test/cbmc/stubs/skipString.c +++ b/test/cbmc/stubs/skipString.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/cbmc/stubs/skipUTF8.c b/test/cbmc/stubs/skipUTF8.c index 67459a11..49f65a29 100644 --- a/test/cbmc/stubs/skipUTF8.c +++ b/test/cbmc/stubs/skipUTF8.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of diff --git a/test/unit-test/core_json_utest.c b/test/unit-test/core_json_utest.c index 3eaf6a90..04952236 100644 --- a/test/unit-test/core_json_utest.c +++ b/test/unit-test/core_json_utest.c @@ -1,5 +1,5 @@ /* - * coreJSON v3.0.1 + * coreJSON v3.0.2 * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a copy of