From 7b70a000468bd1c3dff39e5538c17d6e3b4292c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Afonso=20Janu=C3=A1rio?= Date: Mon, 7 Sep 2026 23:57:19 +0100 Subject: [PATCH] Add missing prototype for newlineScanByteCountForTesting Fixes GH-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. --- src/lib_json/json_reader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib_json/json_reader.cpp b/src/lib_json/json_reader.cpp index 2f901f510..39af2c4c1 100644 --- a/src/lib_json/json_reader.cpp +++ b/src/lib_json/json_reader.cpp @@ -988,6 +988,7 @@ class OurReader { // CharReaderTest/parseCommentsAfterValueScansLinearly). thread_local so it // never races during concurrent parsing; the increment is negligible and only // runs while parsing comments. Not part of the supported public API. +JSON_API size_t& newlineScanByteCountForTesting(); JSON_API size_t& newlineScanByteCountForTesting() { static thread_local size_t count = 0; return count;