Skip to content

Improve nodiscard adoption for OSAL call sites#271

Open
thatguysumeetkumar-code wants to merge 2 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 2 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.

Signed-off-by: Sumitkumar Satpute <sumitkumar.sa.satpute@bti.bmwgroup.com>
@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.4.2) and connecting to it...
INFO: Invocation ID: 84857b2e-34c7-4069-b172-d2b46d7bde78
Computing main repo mapping: 
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 (30 packages loaded, 10 targets configured)

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

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

Analyzing: target //:license-check (138 packages loaded, 2720 targets configured)

Analyzing: target //:license-check (150 packages loaded, 5404 targets configured)

Analyzing: target //:license-check (155 packages loaded, 5453 targets configured)

Analyzing: target //:license-check (155 packages loaded, 5453 targets configured)

Analyzing: target //:license-check (155 packages loaded, 5453 targets configured)

Analyzing: target //:license-check (158 packages loaded, 7340 targets configured)

Analyzing: target //:license-check (161 packages loaded, 10134 targets configured)

Analyzing: target //:license-check (162 packages loaded, 10142 targets configured)

Analyzing: target //:license-check (162 packages loaded, 10142 targets configured)

Analyzing: target //:license-check (162 packages loaded, 10142 targets configured)

INFO: Analyzed target //:license-check (163 packages loaded, 10268 targets configured).
[14 / 16] [Prepa] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
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: 29.972s, Critical Path: 2.75s
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

-use assert and ASSERT_TRUE safeguards

Signed-off-by: Sumitkumar Satpute sumitkumar.sa.satpute@bti.bmwgroup.com
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.

2 participants