Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove yuni volatile warning #1828

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Remove yuni volatile warning #1828

merged 3 commits into from
Dec 18, 2023

Conversation

payetvin
Copy link
Contributor

Antares_Simulator/src/ext/yuni/src/yuni/../yuni/core/string/../traits/extension/../../smartptr/policies/../../atomic/int.hxx:99:90: warning: ‘--’ expression of ‘volatile’-qualified type is deprecated [-Wvolatile]
99 | return (threadSafe) ? Private::AtomicImpl::Operator<size, TP>::Decrement(*this) : (--pValue);

@payetvin payetvin self-assigned this Dec 18, 2023
Copy link

watermelon-copilot-for-code-review bot commented Dec 18, 2023

Watermelon AI Summary

AI Summary deactivated by payetvin

GitHub PRs

Antares_Simulator is an open repo and Watermelon will serve it for free.
🍉🫶
Have you starred Watermelon?

@payetvin payetvin changed the title [Remove yuni volatile warning Remove yuni volatile warning Dec 18, 2023
@flomnes
Copy link
Member

flomnes commented Dec 18, 2023

Is policy SingleThreaded ever used ? It is the only one for which threadSafe = false. For other policies (ObjectLevelLockable, ObjectLevelLockableNotRecursive, ClassLevelLockable), threadSafe = true.

What you're doing is assuming that threadSafe is always true, in other words that SingleThreaded is never used.

Copy link
Member

@flomnes flomnes left a comment

Choose a reason for hiding this comment

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

I added those static_asserts, the code still builds fine. So I assume that threadSafe is always true

    static_assert(!threadSafe);

@flomnes flomnes merged commit ba0adde into develop Dec 18, 2023
4 checks passed
@flomnes flomnes deleted the fix/yuni-warnings branch December 18, 2023 17:00
Copy link

sonarcloud bot commented Dec 18, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

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

Successfully merging this pull request may close these issues.

2 participants