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

CodeQL lint for implicit integer truncation #3113

Open
ripatel-fd opened this issue Oct 12, 2024 · 0 comments
Open

CodeQL lint for implicit integer truncation #3113

ripatel-fd opened this issue Oct 12, 2024 · 0 comments

Comments

@ripatel-fd
Copy link
Contributor

ripatel-fd commented Oct 12, 2024

Implicit integer conversions to a shorter type, such as ulong to ushort, can cause compile failures.

Under -Werror=all, GCC 8.3 does not even allow uchar x[2] = {3,4}; (3 gets promoted to int, then converted to char)

GCC 8.5 is less strict but often broken on main. GCC 12 is least strict, but effectively the default compiler of the Firedancer development team.

We can use CodeQL to detect all such implicit conversions without having to rely on compiler warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant