Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SH] Fix warnings about unhandled switch cases by adding defaults. #2017

Merged
merged 2 commits into from May 16, 2023

Conversation

Rot127
Copy link
Collaborator

@Rot127 Rot127 commented May 12, 2023

Copy link
Contributor

@XVilka XVilka left a comment

Choose a reason for hiding this comment

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

A few still left:

 arch/SH/SHDisassembler.c: In function ‘op4xxb’:
arch/SH/SHDisassembler.c:960:33: warning: ‘rw’ may be used uninitialized [-Wmaybe-uninitialized]
  960 |                                 set_reg_n(info, SH_REG_R0, rw, rw, detail);
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/SH/SHDisassembler.c: In function ‘op4xx5’:
arch/SH/SHDisassembler.c:24:9: warning: ‘rw’ may be used uninitialized [-Wmaybe-uninitialized]
   24 |         switch(rw) {
      |         ^~~~~~
arch/SH/SHDisassembler.c:752:24: note: ‘rw’ was declared here
  752 |         enum direction rw;
      |                        ^~

https://github.com/capstone-engine/capstone/actions/runs/4962032517/jobs/8879573977?pr=2017#step:5:55

@Rot127
Copy link
Collaborator Author

Rot127 commented May 13, 2023

Thanks. cmake and clangd did not catch this for whatever reason. Even with -Wmaybe-uninitialized added to compile options.

Copy link
Contributor

@XVilka XVilka left a comment

Choose a reason for hiding this comment

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

All clear now.

@trufae
Copy link
Contributor

trufae commented May 14, 2023

Can we merge this so I can start testing from the next branch? Thanks @Rot127 ^_^

@XVilka
Copy link
Contributor

XVilka commented May 16, 2023

@kabeor @aquynh

@kabeor
Copy link
Member

kabeor commented May 16, 2023

Thanks, merged.

@kabeor kabeor merged commit 7a3dc32 into capstone-engine:next May 16, 2023
7 checks passed
@Rot127 Rot127 deleted the fix_sh_warnings branch May 16, 2023 10:54
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.

None yet

4 participants