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

Use Travis CI to check for compilation warnings #48

Merged
merged 3 commits into from
Mar 8, 2019

Conversation

mwtoews
Copy link
Collaborator

@mwtoews mwtoews commented Mar 7, 2019

This PR allows Travis CI to compile and perform specific checks on the consistency of code, and ideally guard against introducing "bad code". This is done by passing FFLAGS to pymake, specifically -Werror which treats all warnings as errors, and fails the Travis CI with a log of compilation steps and errors, which is handy to see.

So far, I've added a few specific warnings flags from previous commits for tabs. And added to this PR is -Wcharacter-truncation, as there was a minor discrepancy between the data types.

When potential issues are resolved in the code for each warning type (docs here), then that flag can be added to fflags in autotest/config.py for testing on Travis CI.

Add these flags (based on previous commits to clean up warnings):
 -Werror : Treat all warnings as errors, so it shows info in Travis CI
 -Wtabs : Nonconforming tab characters
 -Wline-truncation : truncated source lines (similar, but not quite
                     the same as `ifort -warn truncated_source`)
Fix by matching type from openspec.inc/FILESPEC.INC
Copy link
Collaborator

@langevin-usgs langevin-usgs left a comment

Choose a reason for hiding this comment

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

I like this. I think it would be great to implement, especially for you Windows people who don't realize the hassles associated with tabs. I tried to implement it for MODFLOW 6, but ran into some issues that I couldn't resolve. These flags did help me find and fix some issues with string assignments, but in the end I couldn't get it to work with all flavors of gfortran, though I may try again at some point.

@emorway-usgs emorway-usgs merged commit a3fde30 into MODFLOW-USGS:develop Mar 8, 2019
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.

3 participants