Skip to content

Fix/suppress new GCC warnings #1752

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

gzz2000
Copy link

@gzz2000 gzz2000 commented Jun 13, 2025

Description

In #1192 the warning Wstringop-overflow was ignored for some GCC versions. I applied the same pragma to another new spot (concurrent_monitor.h:440) where the warning is also being false-positively triggered now.

Fixes #1508

Type of change

Choose one or multiple, leave empty if none of the other choices apply

Add a respective label(s) to PR if you have permissions

  • bug fix - change that fixes an issue
  • new feature - change that adds functionality
  • tests - change in tests
  • infrastructure - change in infrastructure and CI
  • documentation - documentation update

Tests

  • added - required for new features and some bug fixes
  • not needed

Documentation

  • updated in # - add PR number
  • needs to be updated
  • not needed

Breaks backward compatibility

  • Yes
  • No
  • Unknown

Notify the following users

List users with @ to send notifications

Other information

@dnmokhov
Copy link
Contributor

Thank you for submitting this, @gzz2000. Could you please update the copyright year in the modified file: https://github.com/uxlfoundation/oneTBB/actions/runs/15627205507/job/44023614533

@gzz2000
Copy link
Author

gzz2000 commented Jun 13, 2025

Thank you for submitting this, @gzz2000. Could you please update the copyright year in the modified file: https://github.com/uxlfoundation/oneTBB/actions/runs/15627205507/job/44023614533

Sure, updated.

Copy link
Contributor

@dnmokhov dnmokhov left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -437,7 +437,16 @@ class concurrent_monitor_base {
my_waitset.flush_to(temp);
end = temp.end();
for (base_node* n = temp.front(); n != end; n = n->next) {
// GCC 12.x-14.x issues a warning here that to_wait_node(n)->my_is_in_list might have size 0, since n is
// a base_node pointer. (This cannot happen, because only wait_node pointers are added to my_waitset.)
#if (__TBB_GCC_VERSION >= 120100 && __TBB_GCC_VERSION < 150000 ) && !__clang__ && !__INTEL_COMPILER
Copy link
Contributor

Choose a reason for hiding this comment

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

Since the same warning is suppressed on the line 296 and the macros in the "#if" statement are the same, we have the same if statement 4 times. I propose to define the special macro with the content of the statement and reuse it in these 4 places.

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

Successfully merging this pull request may close these issues.

Compilation fails with gcc-12 with possibly false positive warning
3 participants