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

[Compilation] Compile warnings using GCC 14 signedness and missing braces #131

Closed
SiebrenW opened this issue Dec 29, 2024 · 5 comments
Closed
Labels
Attempted Fix A fix has been implemented but not yet confirmed by the issue reporter.

Comments

@SiebrenW
Copy link

The current examples cannot be compiled on a Linux/Arch machine using GCC 14 with the compiler arguments in the CMakeLists.txt files.

The main culprit being -Werror=sign-compare and -Werror=missing-braces implicitly added by -Wall or -Wextra and made an error with -Werror.

Proposals:

silence the errors by either adding some nasty #pragmas or slightly better: add -Wno-error=sign-compare and -Wno-error=missing-braces to the C flags (not replacing the CXX flags)

But preferably, these violations ought to be fixed. IMO a lot of those signed values don't make sense, because it's not checking for or using the properties of those negative values, which would break a lot I presume.

Is it in the cards to make an API change at this level? I like how you're using int32_t instead of int for portability, but I think the function signatures should often not contain signed integer arguments, if ever, so use uint32_t (or often size_t) instead.

Brief example: https://godbolt.org/z/GbqzxjboW

@nicbarker
Copy link
Owner

Hello, and thanks for opening this issue!

Is it in the cards to make an API change at this level? I like how you're using int32_t instead of int for portability, but I think the function signatures should often not contain signed integer arguments, if ever, so use uint32_t (or often size_t) instead.

Absolutely, it's early days yet and getting objectively incorrect things fixed is always going to be a priority over maintaining strict backward compatibility. I will fix any stragglers after #118 is merged.

@nicbarker nicbarker changed the title Compile warnings using GCC 14 signedness and missing braces [Compilers] Compile warnings using GCC 14 signedness and missing braces Dec 30, 2024
@nicbarker
Copy link
Owner

We're ignoring missing braces for now, and I will address the sign compare in the coming days 👍

@nicbarker nicbarker changed the title [Compilers] Compile warnings using GCC 14 signedness and missing braces [Compilation] Compile warnings using GCC 14 signedness and missing braces Jan 2, 2025
@nicbarker
Copy link
Owner

PR for fixing the signed comparisons is up here: #152

@nicbarker
Copy link
Owner

PR has been merged, please let me know if it fixes the issue for you 👍

@nicbarker nicbarker added the Attempted Fix A fix has been implemented but not yet confirmed by the issue reporter. label Jan 2, 2025
@SiebrenW
Copy link
Author

SiebrenW commented Jan 2, 2025

This does fix the warnings. Thanks.

I was fixing them myself initially, thinking I could do it before some family would visit. I don't think I was half way when they showed up :laugh:.

@SiebrenW SiebrenW closed this as completed Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Attempted Fix A fix has been implemented but not yet confirmed by the issue reporter.
Projects
None yet
Development

No branches or pull requests

2 participants