Closed Bug 2066591 Opened 1 month ago Closed 1 month ago

clang 23 ERROR - /builds/worker/checkouts/gecko/security/nss/lib/freebl/lowhash_vector.c:24:19: error: variable 'blLib' set but not used [-Werror,-Wunused-but-set-global]

Categories

(NSS :: Libraries, defect)

defect

Tracking

(nss 3.129)

RESOLVED FIXED
Tracking Status
nss --- 3.129

People

(Reporter: Sylvestre, Assigned: Sylvestre)

References

(Blocks 3 open bugs)

Details

(Keywords: intermittent-failure)

Attachments

(1 external file)

clang 23 added -Wunused-but-set-global, which breaks the NSS build:

security/nss/lib/freebl/lowhash_vector.c:24:19: error: variable 'blLib'
set but not used [-Werror,-Wunused-but-set-global]

The statics blLib and libraryName in lib/freebl/lowhash_vector.c are only
ever assigned in freebl_LoadDSO() and never read. The full loader.c reads
them from BL_Unload(), but this stripped-down variant has no unload path,
so removing them is behaviour-neutral.

Patch: remove the two write-only statics.

clang 23's new -Wunused-but-set-global fails the build:

security/nss/lib/freebl/lowhash_vector.c:24:19: error: variable 'blLib'
set but not used [-Werror,-Wunused-but-set-global]

Both statics are only ever assigned in freebl_LoadDSO(). The full loader.c
reads them from BL_Unload(), but this stripped-down variant has no unload
path, so dropping them is behaviour-neutral.

The severity field is not set for this bug.
:anna.weine, could you have a look please?

For more information, please visit BugBot documentation.

Flags: needinfo?(anna.weine)
Summary: clang 23 -Wunused-but-set-global: write-only blLib/libraryName statics in freebl's lowhash_vector.c → clang 23 ERROR - /builds/worker/checkouts/gecko/security/nss/lib/freebl/lowhash_vector.c:24:19: error: variable 'blLib' set but not used [-Werror,-Wunused-but-set-global]

Pushed by jschanck@mozilla.com:
https://hg.mozilla.org/projects/nss/rev/ca25cbbedf63
Remove write-only blLib and libraryName statics from freebl's lowhash_vector r=nss-reviewers,jschanck

Status: NEW → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED

You won't see the fix on mozilla-central until NSS is updated in bug 2066767

Flags: needinfo?(anna.weine)
Assignee: nobody → sledru
Depends on: 2066767
Blocks: 2066767
No longer depends on: 2066767
Blocks: 2075958
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: