Skip to content

Improve nodiscard adoption for OSAL call sites#271

Open
thatguysumeetkumar-code wants to merge 6 commits into
eclipse-score:mainfrom
thatguysumeetkumar-code:improvement/osal-nodiscard-callsite-handling
Open

Improve nodiscard adoption for OSAL call sites#271
thatguysumeetkumar-code wants to merge 6 commits into
eclipse-score:mainfrom
thatguysumeetkumar-code:improvement/osal-nodiscard-callsite-handling

Conversation

@thatguysumeetkumar-code

Copy link
Copy Markdown
Contributor

Fix the issue : #215

Improvement using [[nodiscrd]] for OSAL return types.

@github-actions

github-actions Bot commented Jun 30, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.6.0) and connecting to it...
INFO: Invocation ID: eec31273-0e75-43c3-a9a9-475f9eff2124
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (35 packages loaded, 10 targets configured)

Analyzing: target //:license-check (80 packages loaded, 10 targets configured)

Analyzing: target //:license-check (112 packages loaded, 109 targets configured)

Analyzing: target //:license-check (151 packages loaded, 2872 targets configured)

Analyzing: target //:license-check (152 packages loaded, 5482 targets configured)

Analyzing: target //:license-check (153 packages loaded, 6257 targets configured)

Analyzing: target //:license-check (163 packages loaded, 8261 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (164 packages loaded, 8271 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

Analyzing: target //:license-check (167 packages loaded, 10159 targets configured)

INFO: Analyzed target //:license-check (169 packages loaded, 10409 targets configured).
[11 / 16] Creating runfiles tree bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/score_tooling+/dash/tool/formatters/dash_format_converter.runfiles [for tool]; 0s local
[13 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 25.542s, Critical Path: 2.91s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

void initIpc()
{
ipcServer.init(makeUniqueIpcName());
static_cast<void>(ipcServer.init(makeUniqueIpcName()));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think ASSERT_TRUE would be nice here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood correctly ASSERT_TRUE(ipcServer.init(makeUniqueIpcName()) == ifappl::CheckpointIpcServer::EIpcInitResult::kOk) << "CheckpointIpcServer init failed";

ipc_channel_ = score::lcm::internal::ControlClientChannel::initializeControlClientChannel();

ipc_request_semaphore_.init(1U, false);
static_cast<void>(ipc_request_semaphore_.init(1U, false));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it make sense to assert here? otherwise we are in an undefined state

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood correctly const auto init_result = ipc_request_semaphore_.init(1U, false); assert((score::lcm::internal::osal::OsalReturnType::kSuccess == init_result) && "ControlClient semaphore initialization failed");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually there are baselibs asserts, think we should be using it SCORE_LANGUAGE_FUTURECPP_ASSERT_PRD_MESSAGE since this would be useful info for user. https://github.com/eclipse-score/baselibs/blob/866daca52e8d886a04628be138800d103a5c015b/score/language/futurecpp/include/score/assert.hpp

Sumitkumar Satpute added 2 commits July 1, 2026 14:53
Signed-off-by: Sumitkumar Satpute <sumitkumar.sa.satpute@bti.bmwgroup.com>
-use assert and ASSERT_TRUE safeguards

Signed-off-by: Sumitkumar Satpute sumitkumar.sa.satpute@bti.bmwgroup.com
-use SCORE Assert Macro

Signed-off-by: Sumitkumar Satpute sumitkumar.sa.satpute@bti.bmwgroup.com

// we definitely shouldn't forget to release semaphore
ipc_request_semaphore_.post();
static_cast<void>(ipc_request_semaphore_.post());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking at this again, I am a bit apprehensive with this one.

Looking at the possible errors we can have EINVAL for which I think we can assert that this is not returned as if an invalid sempahore is used this would be a logical error. And EOVERFLOW for which I would want an error log as it probably means that there is some problem with LCM being stuck.

@MaciejKaszynski MaciejKaszynski Jul 2, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing with the change on Line 383

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address review comments.

-Add errno-based handling for ControlClient semaphore post failures

Signed-off-by: Sumitkumar Satpute sumitkumar.sa.satpute@bti.bmwgroup.com
@thatguysumeetkumar-code

Copy link
Copy Markdown
Contributor Author

@MaciejKaszynski Can I run the same pipeline locally ?
Or It's a CI thing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants