| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…NG branch Sonar c:S935 (CRITICAL): aws_kinesis_connector_worker() is declared void *, but the conditional test-only early exit inside #ifdef UNIT_TESTING used a bare `return;`. Per C99/C11 6.8.6.4, a return without an expression is only permitted in a function whose return type is void. Production builds skip this block, but enabling UNIT_TESTING fails to compile. Change the bare return to `return NULL;` so test builds satisfy the function signature; production control flow is unchanged.
…anch Sonar c:S935 (CRITICAL): pubsub_connector_worker() is declared void *, but the conditional test-only early exit inside #ifdef UNIT_TESTING used a bare `return;`. Per C99/C11 6.8.6.4, a return without an expression is only permitted in a function whose return type is void. Production builds skip this block, but enabling UNIT_TESTING fails to compile. Same pattern as aws_kinesis.c:214 fixed in the previous commit.
…TING branch Sonar c:S935 (CRITICAL): exporting_main() is declared void, but the conditional test-only early exit inside #ifdef UNIT_TESTING used `return NULL;`, which is invalid for a void-returning function per C99/C11 6.8.6.4. Production builds skip the block, but enabling UNIT_TESTING fails to compile. Change the conditional return to a bare `return;`, and remove the stale "@return It always returns NULL" line from the function's docstring (left behind from when the signature was void *). Together with the previous two commits, this closes the c:S935 trio across the exporting subsystem (aws_kinesis, pubsub, exporting_engine).
|
@cubic-dev-ai review this PR |
Sorry, something went wrong.
@stelfrag I have started the AI code review. It will take a few minutes to complete. |
Sorry, something went wrong.
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
sequenceDiagram
participant TR as Unit Test Runner
participant EE as Exporting Engine
participant KW as Kinesis Worker
participant PW as PubSub Worker
Note over TR,PW: Unit Testing Control Flow (Static Analysis Fixes)
TR->>EE: Invoke exporting_main (void)
EE->>EE: Perform main rusage tracking
alt UNIT_TESTING
EE-->>TR: CHANGED: return (void)
end
TR->>KW: Invoke aws_kinesis_connector_worker (void*)
KW->>KW: netdata_mutex_unlock()
alt UNIT_TESTING
KW-->>TR: CHANGED: return NULL (void*)
end
TR->>PW: Invoke pubsub_connector_worker (void*)
PW->>PW: netdata_mutex_unlock()
alt UNIT_TESTING
PW->>PW: CHANGED: break loop
PW-->>TR: Return control/NULL
end
Sorry, something went wrong.
|
Sorry, something went wrong.
There was a problem hiding this comment.
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
* exporting: fix bare return in aws_kinesis_connector_worker UNIT_TESTING branch Sonar c:S935 (CRITICAL): aws_kinesis_connector_worker() is declared void *, but the conditional test-only early exit inside #ifdef UNIT_TESTING used a bare `return;`. Per C99/C11 6.8.6.4, a return without an expression is only permitted in a function whose return type is void. Production builds skip this block, but enabling UNIT_TESTING fails to compile. Change the bare return to `return NULL;` so test builds satisfy the function signature; production control flow is unchanged. * exporting: fix bare return in pubsub_connector_worker UNIT_TESTING branch Sonar c:S935 (CRITICAL): pubsub_connector_worker() is declared void *, but the conditional test-only early exit inside #ifdef UNIT_TESTING used a bare `return;`. Per C99/C11 6.8.6.4, a return without an expression is only permitted in a function whose return type is void. Production builds skip this block, but enabling UNIT_TESTING fails to compile. Same pattern as aws_kinesis.c:214 fixed in the previous commit. * exporting: fix value-returning bare return in exporting_main UNIT_TESTING branch Sonar c:S935 (CRITICAL): exporting_main() is declared void, but the conditional test-only early exit inside #ifdef UNIT_TESTING used `return NULL;`, which is invalid for a void-returning function per C99/C11 6.8.6.4. Production builds skip the block, but enabling UNIT_TESTING fails to compile. Change the conditional return to a bare `return;`, and remove the stale "@return It always returns NULL" line from the function's docstring (left behind from when the signature was void *). Together with the previous two commits, this closes the c:S935 trio across the exporting subsystem (aws_kinesis, pubsub, exporting_engine). * Update src/exporting/pubsub/pubsub.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/exporting/aws_kinesis/aws_kinesis.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/exporting/exporting_engine.c Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Costa Tsaousis <costa@netdata.cloud> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> (cherry picked from commit b132229)
| Back | FazBrowse Home | New Git URL |
Summary