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

Fix compilation on gcc 12.2.0 #2176

Merged
merged 1 commit into from
Oct 23, 2023
Merged

Fix compilation on gcc 12.2.0 #2176

merged 1 commit into from
Oct 23, 2023

Conversation

Quentin01
Copy link
Contributor

Hi,

When compiling on gcc 12.2.0 (default version on Debian bookworm), this error occurs:

In file included from capstone/arch/ARM/../../include/capstone/capstone.h:296,
                 from capstone/arch/ARM/../../Mapping.h:11,
                 from capstone/arch/ARM/ARMInstPrinter.c:32:
capstone/arch/ARM/../../include/capstone/arm.h: In function ‘ARMVPTPredToString’:
capstone/arch/ARM/../../include/capstone/arm.h:159:1: error: control reaches end of non-void function [-Werror=return-type]
  159 | }
      | ^
cc1: all warnings being treated as errors

This PR fix the error.

I could have fixed it with a __builtin_unreachable but it isn't available on MSVC. The assert & the fact that the switch above should handle all valid values of the enum should be enough to prevent issues anyway.

Copy link
Collaborator

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

Can't test it currently. But LGTM.

@Quentin01 Quentin01 force-pushed the tetrane branch 2 times, most recently from 4b2af29 to 0f9a244 Compare October 23, 2023 09:57
@kabeor
Copy link
Member

kabeor commented Oct 23, 2023

Thx, merged.

@kabeor kabeor merged commit 6672fc7 into capstone-engine:next Oct 23, 2023
22 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.

3 participants