Skip to content

framework: resolve compiler warnings#623

Merged
Treece-Burgess merged 1 commit into
icl-utk-edu:masterfrom
dbarry9:06.23.2026_enable-warnings
Jun 24, 2026
Merged

framework: resolve compiler warnings#623
Treece-Burgess merged 1 commit into
icl-utk-edu:masterfrom
dbarry9:06.23.2026_enable-warnings

Conversation

@dbarry9

@dbarry9 dbarry9 commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Pull Request Description

When a build is configured with --enable-warnings, there are unused-variable and sign-compare warnings:

papi.c: In function 'PAPI_set_multiplex':
papi.c:4065:13: warning: unused variable 'ret' [-Wunused-variable]
 4065 |         int ret;
           |              ^~~
papi_preset.c: In function 'papi_load_derived_events_component':
papi_preset.c:1648:57: warning: comparison of integer expressions of different signedness: 'int' and 'size_t' {aka 'long unsigned int'} [-Wsign-compare]
 1648 |                 for (pos = component_prefix_offset; pos < strlen(basename); pos++) {
           |                                                                                      ^

This PR resolves these warnings.

These changes have been tested on a system containing the ARM Neoverse-V2 CPU and the NVIDIA GH200 480GB GPU (Grace-Hopper architecture).

Author Checklist

  • Description
    Why this PR exists. Reference all relevant information, including background, issues, test failures, etc
  • Commits
    Commits are self contained and only do one thing
    Commits have a header of the form: module: short description
    Commits have a body (whenever relevant) containing a detailed description of the addressed problem and its solution
  • Tests
    The PR needs to pass all the tests

@dbarry9 dbarry9 requested a review from Treece-Burgess June 23, 2026 21:55
@dbarry9

dbarry9 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@Treece-Burgess There are also some compiler warnings in the cuda component when --enable-warnings is used, but I wanted to keep the resolution of framework-related compiler warnings to its own PR.

@Treece-Burgess

Copy link
Copy Markdown
Contributor

When a build is configured with --enable-warnings, there are unused-variable and sign-compare warnings:

I can take care of the cuda component compilation warnings.

When a build is configured with --enable-warnings, there are
unused-variable and sign-compare warnings. These changes resolve the
warnings.

These changes have been tested on a system containing the ARM
Neoverse-V2 CPU and the NVIDIA GH200 480GB GPU (Grace-Hopper
architecture).
@dbarry9 dbarry9 force-pushed the 06.23.2026_enable-warnings branch from 3935642 to 48a8c77 Compare June 24, 2026 15:10

@Treece-Burgess Treece-Burgess left a comment

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 have been able to recreate the compilation warnings on Hopper1 at Oregon (CPU: ARM Neoverse V2, GPU: 1 * NVIDIA GH200) with the configure ./configure --prefix=$PWD/test-install --enable-warnings --with-debug=yes:

papi.c:4065:13: warning: unused variable ‘ret’ [-Wunused-variable]
 4065 |         int ret;
papi_preset.c:1648:57: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
 1648 |                 for (pos = component_prefix_offset; pos < strlen(basename); pos++) {

This PR resolves the compilation warnings. As a sanity check I ran ./papi_avail and ./papi_command_line PAPI_FP_OPS as this change is made in papi_preset.c. Both functioned as expected.

@Treece-Burgess Treece-Burgess merged commit fed7bf7 into icl-utk-edu:master Jun 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants