Skip to content

[NFC][ELF][CHERI] Fix a set but not used warning#804

Merged
bsdjhb merged 1 commit intoCTSRD-CHERI:devfrom
bsdjhb:warnfix
Jan 23, 2026
Merged

[NFC][ELF][CHERI] Fix a set but not used warning#804
bsdjhb merged 1 commit intoCTSRD-CHERI:devfrom
bsdjhb:warnfix

Conversation

@bsdjhb
Copy link
Contributor

@bsdjhb bsdjhb commented Jan 22, 2026

lld/ELF/Arch/Cheri.cpp:496:17: warning: variable 's' set but not used [-Wunused-but-set-variable]
496 | if (Symbol *s = dyn_cast<Symbol *>(realTarget.symOrSec))
| ^

Fixes: b9963fa ("[ELF][CHERI] Add new getTargetType to separate encoding from classification")

lld/ELF/Arch/Cheri.cpp:496:17: warning: variable 's' set but not used [-Wunused-but-set-variable]
  496 |     if (Symbol *s = dyn_cast<Symbol *>(realTarget.symOrSec))
      |                 ^

Fixes: b9963fa ("[ELF][CHERI] Add new getTargetType to separate encoding from classification")
@bsdjhb bsdjhb requested a review from jrtc27 January 22, 2026 18:01
Copy link
Member

@jrtc27 jrtc27 left a comment

Choose a reason for hiding this comment

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

Not sure how I missed that with how many times I must have compiled these files :( hopefully down to my particular environment not warning rather than blindness…

@bsdjhb
Copy link
Contributor Author

bsdjhb commented Jan 23, 2026

It wasn't a fatal warning and I only noticed it by chance while working on the c18n branch myself.

@bsdjhb bsdjhb merged commit e67a3ba into CTSRD-CHERI:dev Jan 23, 2026
7 checks passed
@bsdjhb bsdjhb deleted the warnfix branch January 23, 2026 14:41
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

Comments