Add missing prototype for newlineScanByteCountForTesting - #1715
Open
afonsojanu wants to merge 1 commit into
Open
Add missing prototype for newlineScanByteCountForTesting#1715afonsojanu wants to merge 1 commit into
afonsojanu wants to merge 1 commit into
Conversation
Fixes open-source-parsersGH-1705. json_reader.cpp defines this function with no prior declaration in the same translation unit, so building with stricter flags like clang's -Wmissing-prototypes flags it as a possible externally-callable function with no visible prototype, even though it's only meant for the unit tests (main.cpp forward-declares it itself before using it). Adding a plain prototype directly above the definition, same as the reporter suggested, silences the warning without touching the public API surface: the function still isn't declared in any installed header. Reran the full meson/ninja test suite (all 3 suites green) and confirmed with a standalone clang++ compile that -Wmissing-prototypes -Werror on json_reader.cpp fails before this change and passes after it. Also ran clang-format per CONTRIBUTING.md, no further diff.
|
| Filename | Overview |
|---|---|
| src/lib_json/json_reader.cpp | Adds a matching prototype for existing test instrumentation; no runtime behavior or public-header surface changes. |
Reviews (1): Last reviewed commit: "Add missing prototype for newlineScanByt..." | Re-trigger Greptile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1705.
newlineScanByteCountForTesting()injson_reader.cppis defined with no prior declaration in the same translation unit. Building with stricter warning flags (clang's-Wmissing-prototypes, as reported from the OpenXR SDK build) flags it as a possible externally-callable function with no visible prototype, even though it's test-only instrumentation (main.cppforward-declares it itself before using it, since it's not part of any installed header).Adds a plain prototype directly above the definition, matching what you suggested in the issue. This silences the warning without changing the public API surface at all: the function still isn't declared anywhere in
include/.Verified with a standalone
clang++ -Wmissing-prototypes -Werrorcompile ofjson_reader.cpp: fails with the exact error from the issue on unmodified master, passes with this change. Also reran the full meson/ninja test suite (unittest_jsoncpp_test,unittest_jsontestrunner,jsonchecker_jsontestrunner), all green, and ranclang-formatper CONTRIBUTING.md with no further diff.