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

Parse C++ warnings more specifically #1852

Merged
merged 11 commits into from
Nov 18, 2020
Merged

Parse C++ warnings more specifically #1852

merged 11 commits into from
Nov 18, 2020

Conversation

jougs
Copy link
Contributor

@jougs jougs commented Nov 16, 2020

No description provided.

@heplesser
Copy link
Contributor

@jougs 👍! I'd be very happy to review when its past the draft stage :).

@jougs jougs requested review from hakonsbm and heplesser November 16, 2020 21:25
@jougs jougs self-assigned this Nov 16, 2020
@jougs jougs added I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Critical Needs to be addressed immediately T: Maintenance Work to keep up the quality of the code and documentation. labels Nov 16, 2020
@jougs jougs added this to the NEST 3.0 milestone Nov 16, 2020
Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

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

@jougs Well done, much nicer than my #1842. Just one little suggestion for efficiency ;).

extras/parse_travis_log.py Outdated Show resolved Hide resolved
@jougs
Copy link
Contributor Author

jougs commented Nov 16, 2020

Looking at the few "real" warnings now, I think we can even eliminate them completely. I'll add a printout of all found warnings to this PR, but would file another one to get them fixed.

@heplesser
Copy link
Contributor

Looking at the few "real" warnings now, I think we can even eliminate them completely. I'll add a printout of all found warnings to this PR, but would file another one to get them fixed.

Most of them are in a very deep part of the SLI scanner, where some case-fallthroughs may be intentional. If you dare to touch such ancient code ;).

The remainder seems to come from the way be block out MPI code if building without MPI, that should be easily fixable by moving all HAVE_MPIs out of functions.

@jougs
Copy link
Contributor Author

jougs commented Nov 16, 2020

@heplesser: actually, I don't dare ;-)

In 1f2f5c4 I've now refactored the MPIManager and MUSICManager along the lines you suggested and think we should just live with the remaining four warnings in SLI. I'll revisit the two conngen related warnings in the FULL build when merging these changes into the branch #1830 is based off.

@jougs jougs marked this pull request as ready for review November 16, 2020 23:23
Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

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

@jougs Thanks, just two small glitches (one confirmed by Travis, one suspected).

nestkernel/mpi_manager.cpp Outdated Show resolved Hide resolved
nestkernel/music_manager.cpp Outdated Show resolved Hide resolved
@heplesser
Copy link
Contributor

@heplesser: actually, I don't dare ;-)

Maybe @diesmann would dare descend into the depths of the SLI scanner?

Co-authored-by: Hans Ekkehard Plesser <[email protected]>
@jougs
Copy link
Contributor Author

jougs commented Nov 17, 2020

@heplesser: actually, I don't dare ;-)

Maybe @diesmann would dare descend into the depths of the SLI scanner?

We could just try adding breaks to the statements and see if anything breaks 😉 If not, we're probably safe - the times where people get adventurous with new SLI code are likely to be over and the code used from within the SLI library and PyNEST should be mostly stable.

@hakonsbm
Copy link
Contributor

@jougs I tried adding breaks there in in my previous PR (8a2eefa). It broke the SLI scanner, so I figured it was best to just live with it (914e420).

@jougs
Copy link
Contributor Author

jougs commented Nov 17, 2020

Thanks @hakonsbm. Another possibility would be to ignore those four manually and just not count them.

Copy link
Contributor

@heplesser heplesser left a comment

Choose a reason for hiding this comment

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

👍 Looks good now and all tests have passed (macOS still running and expected to fail due to #1839). I suggest to merge this once @hakonsbm has also approved, then @lekshmideepu can merge into #1839 and all will be well again :).

@heplesser
Copy link
Contributor

Thanks @hakonsbm. Another possibility would be to ignore those four manually and just not count them.

I would leave them in, we handle them nicely now. The scanner code is actually quite interesting, but to figure out precisely how to replace the fall-throughs would require a deeper understanding of the state machine than I have time to acquire right now (or blatant copy-pasting of the code one calls through to). But definitely not in this PR ;).

@jougs
Copy link
Contributor Author

jougs commented Nov 17, 2020

@heplesser

I would leave them in, we handle them nicely now.

Argh! I went ahead and silenced them in 4c64c3c just two minutes before I saw your comment. Should I revert?

... would require a deeper understanding of the state machine than I have time to acquire right now

And even if you had time, I bet you'd find a a better use for it somewhere else ;-)

@diesmann
Copy link

diesmann commented Nov 17, 2020 via email

@heplesser
Copy link
Contributor

Argh! I went ahead and silenced them in 4c64c3c just two minutes before I saw your comment. Should I revert?

No keep them in :)!

@hakonsbm
Copy link
Contributor

@jougs @heplesser Isn't it better to revert and add them to the expected warnings?

@heplesser
Copy link
Contributor

@jougs @heplesser Isn't it better to revert and add them to the expected warnings?

Almost a philosophical question. By exempting some, but not all warnings that are known to us, have been evaluated as not problematic and difficult to fix, we split warnings into two categories, the expliclitly ignored and the ignored-by-count. Is this split warranted, or should we treat all on an equal footing? By just considering a count, it could happen that some warnings disappear and are just replaced by other warnings, while explicit checks avoid this. One problem with the explicit warnings is that they will resurface if a change in a different part of a source file changes line numbers.

Given that this blocks our CI pipeline, I am much in favor of a decent working solution now and delegation of philosophical matters to a follow-up issue.

@hakonsbm
Copy link
Contributor

I suppose with only a handful warnings it is sensible to ignore them explicitly as known warnings. However, the check for known warnings doesn't work right now so the known warnings are not ignored and Travis fails. Since it's matching the whole line, the known warning strings may be missing newlines at the end.

@jougs
Copy link
Contributor Author

jougs commented Nov 17, 2020

@hakonsbm: I've added a call to strip() in ae7da9f, hoping that this resolves the problem.

Copy link
Contributor

@hakonsbm hakonsbm left a comment

Choose a reason for hiding this comment

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

Looks like using strip() fixes the problem, so I'm approving.

@jougs
Copy link
Contributor Author

jougs commented Nov 18, 2020

OK. My most recent commit now also fixed the final four warnings on the Clang-build and we're down to 0 (in numbers: zero!) in all but the libneurosim-enabled build (but the two currently expected warnings there might go away with a merge of #1830).

The Mac OS X build is failing expectedly due to #1839.

@jougs
Copy link
Contributor Author

jougs commented Nov 18, 2020

Given the two positive reviews and the fact that I'm up early, I'm just merging myself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: No breaking change Previously written code will work as before, no one should note anything changing (aside the fix) S: Critical Needs to be addressed immediately T: Maintenance Work to keep up the quality of the code and documentation.
Projects
Development

Successfully merging this pull request may close these issues.

4 participants