Skip to content

Comments

Change how unused function parameters are handled#1247

Closed
leekillough wants to merge 3 commits intosstsimulator:develfrom
leekillough:unused_parameters
Closed

Change how unused function parameters are handled#1247
leekillough wants to merge 3 commits intosstsimulator:develfrom
leekillough:unused_parameters

Conversation

@leekillough
Copy link
Contributor

This changes the UNUSED() macro to be used within the body of a function rather than inside its declaration

  • It avoids cluttering the function declaration, which is visually distracting and might complicate doc generation tools
  • It emphasizes that the parameter being unused is an implementation detail of the function and not a part of its interface
  • It is used within the body of a function with a syntax which makes it clear that it should not be used in a function declaration
  • The old UNUSED() macro added attributes to parameters; the new UNUSED() macro casts a parameter to void to hide the unused parameter warning
  • The old UNUSED() macro was used in some function declarations without definitions, where it had no effect; these have been removed
  • The new UNUSED() macro appears at the beginning of a function definition and "declares" that a parameter is unused
  • -Werror=unused-parameter is added to builds so that unused parameters not marked with UNUSED() are errors rather than warnings
  • It fixes one unused parameter in rng.h which was not marked UNUSED()
  • Except for a couple of places, which had unused parameter packs or had commented-out function declarations with UNUSED() in them, this was all automatically done by a script (attached), which can be run on other codes-in-progress

@github-actions github-actions bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) AT: CLANG-FORMAT FAIL labels Mar 13, 2025
@github-actions
Copy link

CLANG-FORMAT TEST - FAILED (on last commit):
Run > ./scripts/clang-format-test.sh using clang-format v12 to check formatting

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

CMAKE-FORMAT TEST - PASSED

@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 Mar 13, 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) and removed AT: CLANG-FORMAT FAIL AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Mar 13, 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'.

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

CLANG-FORMAT TEST - FAILED (on last commit):
Run > ./scripts/clang-format-test.sh using clang-format v12 to check formatting

@github-actions github-actions bot removed the AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) label Mar 13, 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'.

@leekillough leekillough marked this pull request as draft March 13, 2025 16:57
@feldergast feldergast added the AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) label Mar 18, 2025
@leekillough leekillough deleted the unused_parameters branch March 31, 2025 04:10
@berquist berquist added this to the SST V15.0.0 milestone Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AT: CLANG-FORMAT FAIL AT: CMAKE-FORMAT PASS AT: WIP Mark PR as a Work in Progress (No Autotesting Performed)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants