Skip to content

cpuset: fix cppcheck missingReturn errors#26

Draft
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-cppcheck-findings
Draft

cpuset: fix cppcheck missingReturn errors#26
Copilot wants to merge 5 commits intomasterfrom
copilot/fix-cppcheck-findings

Conversation

Copy link
Copy Markdown

Copilot AI commented Feb 22, 2026

Functions in src/cpuset.c using #if/#elif preprocessor chains without a final #else clause trigger cppcheck missingReturn errors, since no return statement exists when none of the defined macros match.

Changes

  • Added #else return 0; fallback to the six affected functions:
    • ha_cpuset_set, ha_cpuset_clr — already had an early return 1 guard, missing #else in the macro chain
    • ha_cpuset_count, ha_cpuset_ffs, ha_cpuset_isequal, ha_cpuset_size — no fallback path at all

Before:

int ha_cpuset_size()
{
#if defined(CPUSET_USE_CPUSET) || defined(CPUSET_USE_FREEBSD_CPUSET)
    return CPU_SETSIZE;
#elif defined(CPUSET_USE_ULONG)
    return LONGBITS;
#endif  // ← no return if neither macro is defined
}

After:

int ha_cpuset_size()
{
#if defined(CPUSET_USE_CPUSET) || defined(CPUSET_USE_FREEBSD_CPUSET)
    return CPU_SETSIZE;
#elif defined(CPUSET_USE_ULONG)
    return LONGBITS;
#else
    return 0;
#endif
}
Original prompt

This section details on the original issue you should resolve

<issue_title>fix cppcheck finding</issue_title>
<issue_description>we need to address the following cppcheck finding

src/cpuset.c:21:11: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
src/cpuset.c:36:11: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
src/cpuset.c:100:1: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
src/cpuset.c:124:1: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
src/cpuset.c:152:1: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
src/cpuset.c:163:1: error: Found an exit path from function with non-void return type that has missing return statement [missingReturn]
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

chipitsine and others added 4 commits February 21, 2026 23:08
quic-interop runner is using features available in Docker v28.1
while Github runner includes v28.0

let's for sure setup the latest available
Correct multiple typos and wording issues in source files, documentation, and CLI tools. Changes include fixes such as "specifiy → specify", "explicitely → explicitly", "targetting → targeting", "therefor → therefore", "accross → across", "explaination → explanation", and similar minor corrections. These updates improve clarity, consistency, and professionalism in user-facing docs, comments, and internal code annotations.
since 6499c0a halog is being build
in vtest workflow, no need to build it two times
Co-authored-by: chipitsine <2217296+chipitsine@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix cppcheck findings in cpuset.c cpuset: fix cppcheck missingReturn errors Feb 22, 2026
Copilot AI requested a review from chipitsine February 22, 2026 21:35
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.

fix cppcheck finding

2 participants