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

Warning for mismatched declaration/definition with enum #54706

Open
rth7680 opened this issue Apr 1, 2022 · 0 comments
Open

Warning for mismatched declaration/definition with enum #54706

rth7680 opened this issue Apr 1, 2022 · 0 comments
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer

Comments

@rth7680
Copy link

rth7680 commented Apr 1, 2022

For a testcase such as

enum E { l = -1, z = 0, g = 1 };
int foo(void);
enum E foo(void) { return z; }

If the implementation type of enum E is not int, we will correctly emit an error (e.g. -fshort-enums).
It would be desirable to emit a warning in this case, because it is probably a mistake and definitely a portability error.

@EugeneZelenko EugeneZelenko added clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer and removed new issue labels Apr 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:diagnostics New/improved warning or error message in Clang, but not in clang-tidy or static analyzer
Projects
None yet
Development

No branches or pull requests

2 participants