Skip to content

Get rid of GCC false -Wmissing-noreturn warnings; remove unnecessary warning suppression code#1337

Merged
feldergast merged 1 commit intosstsimulator:develfrom
leekillough:noreturn
May 15, 2025
Merged

Get rid of GCC false -Wmissing-noreturn warnings; remove unnecessary warning suppression code#1337
feldergast merged 1 commit intosstsimulator:develfrom
leekillough:noreturn

Conversation

@leekillough
Copy link
Contributor

This adds DISABLE_WARN_MISSING_NORETURN, to address GCC -Wmissing-noreturn false warnings introduced by recent PRs. It is only needed in .cc files which define virtual functions which do not return; it is not needed in .h files and there is no change needed for the virtual function declarations.

GCC (but not Clang) has a bug where -Wmissing-noreturn warnings are printed for virtual functions defined outside of class which call [[noreturn]] functions but are not themselves marked [[noreturn]]. [[noreturn]] is a function attribute, not a type attribute, and is not inherited. A call to a virtual function with dynamic dispatch cannot be considered [[noreturn]] even if its declarations are marked [[noreturn]], because it can be overriden with a function which is not [[noreturn]], and a virtual function should not be warned about not being marked [[noreturn]] even if it calls a [[noreturn]] function, because [[noreturn]] adds no value to a virtual function and only serves to remove a false warning. There is discussion here, here and here.

This also removes some warning suppression methods which are now unnecessary:

  1. UNUSED() macro can suppress warnings about unused variables and function parameters
  2. It is not necessary to return dummy values from functions after Output::fatal() is called, since it is now marked [[noreturn]]

@github-actions github-actions bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) AT: CLANG-FORMAT PASS and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels May 15, 2025
@github-actions
Copy link

CLANG-FORMAT TEST - PASSED

@github-actions github-actions bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) AT: CMAKE-FORMAT PASS and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels May 15, 2025
@github-actions
Copy link

CMAKE-FORMAT TEST - PASSED

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; this inspection will remain valid until a new commit to source branch is performed.

@sst-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects:

Pull Request Auto Testing STARTING (click to expand)

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements

  • Build Num: 2060
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MR-2

  • Build Num: 2016
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MT-2

  • Build Num: 2015
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core_Make-Dist

  • Build Num: 798
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_OSX-14-XC15-ARM2_OMPI-4.1.6_PY3.10_sst-elements

  • Build Num: 572
  • Status: STARTED

Using Repos:

Repo: CORE (leekillough/sst-core)
  • Branch: noreturn
  • SHA: c83e6aa
  • Mode: TEST_REPO
Repo: SQE (sstsimulator/sst-sqe)
  • Branch: devel
  • SHA: a476e437d8eeb4c8330a9af35322dca689c4cec4
  • Mode: SUPPORT_REPO
Repo: ELEMENTS (sstsimulator/sst-elements)
  • Branch: devel
  • SHA: 8ab6dcc60207adc5b8be6775e2675dc2a031da89
  • Mode: SUPPORT_REPO
Repo: MACRO (sstsimulator/sst-macro)
  • Branch: devel
  • SHA: 31e2c16aa4d07b502bcd9c97b1872a0329ed0b38
  • Mode: SUPPORT_REPO

Pull Request Author: leekillough

@sst-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED

Pull Request Auto Testing has PASSED (click to expand)

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements

  • Build Num: 2060
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MR-2

  • Build Num: 2016
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MT-2

  • Build Num: 2015
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core_Make-Dist

  • Build Num: 798
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_OSX-14-XC15-ARM2_OMPI-4.1.6_PY3.10_sst-elements

  • Build Num: 572
  • Status: PASSED

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Merge Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED AND APPROVED by [ feldergast ]!

@sst-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Pull Request MUST BE MERGED MANUALLY BY Project Team - This Repo does not support Automerge

@leekillough leekillough changed the title Git rid of GCC false -Wmissing-noreturn warnings; remove unnecessary warning suppression code Get rid of GCC false -Wmissing-noreturn warnings; remove unnecessary warning suppression code May 15, 2025
@sst-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Pull Request MUST BE MERGED MANUALLY BY Project Team - This Repo does not support Automerge

@leekillough
Copy link
Contributor Author

GCC bug submitted:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120300

@feldergast feldergast merged commit 542a50e into sstsimulator:devel May 15, 2025
7 checks passed
@leekillough leekillough deleted the noreturn branch October 5, 2025 17:56
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.

3 participants