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

FALLTHROUGH macro not compiled with GCC < 7.0 #255

Closed
vcoda opened this issue Mar 24, 2024 · 3 comments
Closed

FALLTHROUGH macro not compiled with GCC < 7.0 #255

vcoda opened this issue Mar 24, 2024 · 3 comments

Comments

@vcoda
Copy link
Contributor

vcoda commented Mar 24, 2024

attribute((fallthrough)) not supported by GCC 6.8, so this check works only for newer compilers:

#if defined(__clang__) || defined(__GNUC__) || defined(__APPLE_CC__)
#define FALLTHROUGH __attribute__((fallthrough))
#else
#define FALLTHROUGH
#endif

Better to improve check as the following:
#if defined(__GNUC__) && __GNUC__ >= 7

@vcoda
Copy link
Contributor Author

vcoda commented Mar 24, 2024

@spencer-lunarg
Copy link
Contributor

@vcoda I agree this should work for older gcc versions, my only concern is I don't have an immediate way to test it

If you are willing to make a PR with the macro #if change and confirm it works, would be happy to take it

@spencer-lunarg
Copy link
Contributor

closed with #258

(thanks for making the PR)

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

No branches or pull requests

2 participants