Skip to content

Fix missing prototype for newlineScanByteCountForTesting - #1720

Merged
baylesj merged 2 commits into
open-source-parsers:masterfrom
Tyagiquamar:fix-missing-prototype-1705
Oct 26, 2026
Merged

baylesj merged 2 commits into
open-source-parsers:masterfrom
Tyagiquamar:fix-missing-prototype-1705

Conversation

@Tyagiquamar

Copy link
Copy Markdown
Contributor

Problem

When compiling JsonCpp with -Wmissing-prototypes (or strict compiler flags treating missing function prototypes as errors), GCC/Clang emits a compiler error in src/lib_json/json_reader.cpp:

error: no previous prototype for 'size_t& Json::newlineScanByteCountForTesting()' [-Werror=missing-prototypes]

Fixes #1705.

Solution

Add explicit prototype declaration JSON_API size_t& newlineScanByteCountForTesting(); matching the function signature before its definition in src/lib_json/json_reader.cpp.

Verification

  • Built in Docker with GCC 14 and -DCMAKE_CXX_FLAGS='-Wmissing-prototypes': compiled cleanly with zero errors/warnings on newlineScanByteCountForTesting.
  • Ran full test suite in Docker: all 131 tests passed (100% pass rate).

Closes open-source-parsers#1705. Adds explicit prototype declaration for
newlineScanByteCountForTesting() to prevent compiler errors when
building with -Wmissing-prototypes.

Signed-off-by: Tyagiquamar <mohdquamartyagi@gmail.com>
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge.

Summary

Adds a declaration for newlineScanByteCountForTesting() immediately before its definition in src/lib_json/json_reader.cpp.

  • Strict builds see the newline scan counter's prototype before its definition.

Reviews (2) · Last reviewed commit: "Merge branch 'master' into fix-missing-p..." · Reviewed by Greptile

@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 40347608363

Coverage remained the same at 89.926%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 2740
Covered Lines: 2615
Line Coverage: 95.44%
Relevant Branches: 2640
Covered Branches: 2223
Branch Coverage: 84.2%
Branches in Coverage %: Yes
Coverage Strength: 23835.16 hits per line

💛 - Coveralls

@baylesj
baylesj merged commit 93acc7b into open-source-parsers:master Oct 26, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing prototype for function added in 1.9.8

3 participants