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

GNU -Wall Warning Reduction #1049

Conversation

scrasmussen
Copy link
Member

Reducing GNU -Wall warnings per issue #495.

Commits fix the following warning flags implied in -Wall

Compiler Flag Description
-Wampersand Warn about missing ampersand in continued character constants
-Wtabs By default, tabs are accepted as whitespace, but tabs are not members of the Fortran Character Set.
-Wline-truncation Warn when a source code line will be truncated
-Wcharacter-truncation Warn when a character assignment will truncate the assigned string
-Wreturn-type Warn when return value is not set

Copy link
Collaborator

@SamuelTrahanNOAA SamuelTrahanNOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good changes. A note on this one. Perhaps the GNU compiler is not up-to-date, but:

Warn when a source code line will be truncated

The line length limit in Fortran 2023 is ten thousand characters (10,000 characters). For continued lines (using &) the limit is one million characters (1,000,000 characters). In other words, there's probably nowhere in the UFS code that passes the Fortran line length limits. Only the most complicated cpp-generated code risks hitting the line length limits. Alas, we are not using 2030s-era compilers, so we are stuck with the Fortran 2018 limits.

@scrasmussen scrasmussen force-pushed the compiler-warning-reduction/ampersand_return-type_tab_truncation branch from c27ffe3 to 64d33d5 Compare May 9, 2024 19:12
@grantfirl
Copy link
Collaborator

This should also be targeted at ufs-community:ufs/dev

@scrasmussen scrasmussen force-pushed the compiler-warning-reduction/ampersand_return-type_tab_truncation branch from 64d33d5 to add0661 Compare December 11, 2024 18:33
@scrasmussen
Copy link
Member Author

Closing because PR #1105 replaces it

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

Successfully merging this pull request may close these issues.

6 participants