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

[Feat] Fix compiler warnings from -Wpedantic #2880

Closed
nilason opened this issue Mar 6, 2023 · 2 comments
Closed

[Feat] Fix compiler warnings from -Wpedantic #2880

nilason opened this issue Mar 6, 2023 · 2 comments
Labels
C Related code is in C enhancement New feature or request
Milestone

Comments

@nilason
Copy link
Contributor

nilason commented Mar 6, 2023

Compiling with -Wall -Wextra and -Wpedantic triggers a number of mostly (if not only) trivial warnings.
Addressing these warnings contribute to keep the code in good shape according to ISO standards, moreover potentially enables the use of -Wpedantic in combination with -Werror.

Following warnings are issued:

Follow-up on #2747.

Background in parenthesis:
The initial reason for looking at also this level of warnings, was the four GCC CI runs, which all behaves as one and the same. I believe there is potential to reduce them to one runner. But that is a question for another issue.

@nilason nilason added the enhancement New feature or request label Mar 6, 2023
@nilason nilason added this to the 8.3.0 milestone Mar 6, 2023
@nilason nilason added the C Related code is in C label Mar 6, 2023
@wenzeslaus
Copy link
Member

...the four GCC CI runs, which all behaves as one and the same.

Part of the original motivation was indeed the different levels of required "code correctness" and understanding that while version A works, it not okay for version B. However, the other reason was compatibility. It explicitly checks all supported versions. I also remember fixing some C++ issue where two different versions allowed two different constructs, but only one one of these was accepted by both. However, I don't remember if this was more about compiler versions (both clang and GCC) or about standard versions. It was also without the pedantic behavior. The tests for all supported versions still makes sense to me, though.

@nilason
Copy link
Contributor Author

nilason commented Mar 19, 2023

GRASS code in itself now compiles without errors using -Wpedantic, only #2899 is needed to enable the flag on the CI runners.

@nilason nilason closed this as completed Mar 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C Related code is in C enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants