open-source-parsers / open-source-parsers/jsoncpp
Missing prototype for function added in 1.9.8
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 8.9k
- Forks
- 2.7k
- Avg merge
- 31m
- Merged PRs (30d)
- 1
Description
Describe the bug
When I imported this into the OpenXR SDK repo to update, our stricter compile flags caught a missing prototype.
../src/external/jsoncpp/src/lib_json/json_reader.cpp:984:18: error: no previous prototype for function 'newlineScanByteCountForTesting' [-Werror,-Wmissing-prototypes]
JSON_API size_t& newlineScanByteCountForTesting() {
^
../src/external/jsoncpp/src/lib_json/json_reader.cpp:984:10: note: declare 'static' if the function is not intended to be used outside of this translation unit
JSON_API size_t& newlineScanByteCountForTesting() {
^
static
I understand this is not intended to be public API. I think a prototype directly above it would satisfy the warning.
To Reproduce
Steps to reproduce the behavior:
- Build with clang-10 (or newer) and
-Werror,-Wmissing-prototypes
Expected behavior
For this to build as a drop in replacement for the previous version.
Desktop (please complete the following information):
- OS: Linux
- Meson version: n/a, submodule, using CMake
- Ninja version: not sure but old and not really relevant. Build image is
khronosgroup/docker-images:openxr-sdk.20250603@sha256:81a18d30b202bbc2f8ce0cd579991fe6cb235eb3c2045e94a12fa5a4d5b17882
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/lib_json/json_reader.cpp at newlineScanByteCountForTesting and inspect the surrounding declarations. Rebuild with clang and -Werror,-Wmissing-prototypes; done means the missing-prototype warning is resolved and jsoncpp builds as a drop-in replacement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 87/100