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

Fix MSVC-specific compiler warnings / tweak method names #1168

Merged
merged 7 commits into from Jan 17, 2022

Conversation

ischoegl
Copy link
Member

@ischoegl ischoegl commented Jan 15, 2022

Changes proposed in this pull request

Over the past couple of merges, several windows (MSVC)-specific compiler warnings appeared that were not caught when developing with g++. Some of the warnings are quite long, despite being triggered by trivial causes. The following are affected:

  • StoichManager.h / ThirdBodyCalc.h ... Eigen uses int to index, compared to most internal indices being size_t
  • Some formatting / type-cast issues in ReactorNet.h
  • Some other minor issues that resulted in warnings.
  • Add missing 's' in derivative accessor names (e.g. Kinetics.net_production_rates_ddX instead of Kinetics.net_production_rate_ddX), as introduced in Sparse Jacobians for GasKinetics #1089

Checklist

  • The pull request includes a clear description of this code change
  • Commit messages have short titles and reference relevant issues
  • Build passes (scons build & scons test) and unit tests address code coverage
  • Style & formatting of contributed code follows contributing guidelines
  • The pull request is ready for review

@codecov
Copy link

codecov bot commented Jan 15, 2022

Codecov Report

Merging #1168 (9b60e0b) into main (ec85c24) will decrease coverage by 0.00%.
The diff coverage is 93.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1168      +/-   ##
==========================================
- Coverage   65.35%   65.35%   -0.01%     
==========================================
  Files         315      315              
  Lines       45995    45999       +4     
  Branches    19531    19531              
==========================================
+ Hits        30060    30062       +2     
- Misses      13443    13445       +2     
  Partials     2492     2492              
Impacted Files Coverage Δ
include/cantera/kinetics/ThirdBodyCalc.h 98.90% <80.00%> (-1.10%) ⬇️
include/cantera/kinetics/StoichManager.h 94.77% <88.88%> (-0.30%) ⬇️
include/cantera/base/Units.h 70.00% <100.00%> (ø)
src/base/Units.cpp 82.84% <100.00%> (ø)
src/kinetics/ReactionFactory.cpp 92.11% <100.00%> (ø)
src/oneD/Sim1D.cpp 73.63% <100.00%> (-0.07%) ⬇️
src/zeroD/ReactorNet.cpp 82.73% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec85c24...9b60e0b. Read the comment docs.

@ischoegl ischoegl requested a review from a team January 15, 2022 06:29
@ischoegl ischoegl changed the title Fix MSVC-specific compiler warnings Fix MSVC-specific compiler warnings / tweak method names Jan 15, 2022
@ischoegl
Copy link
Member Author

ischoegl commented Jan 15, 2022

@speth ... looks like I overlooked an 's' in the accessor method names in #1089 (oops, had skipped a redundant ‘s’ on purpose when the names were longer, but with the updated ddX nomenclature this rationale does not apply). Also, it turns out that some types used by Eigen::Triplet created copious warnings in MSVC (that I didn't see as I routinely use gcc to develop). This PR should fix all of those issues (and some other minor warnings).

Copy link
Member

@speth speth left a comment

Choose a reason for hiding this comment

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

Thanks for trying to clean these up. Compiler warnings that sneak in on other platforms are always kind of an unpleasant surprise when you switch to a new build environment.

include/cantera/kinetics/StoichManager.h Outdated Show resolved Hide resolved
include/cantera/kinetics/StoichManager.h Outdated Show resolved Hide resolved
src/kinetics/ReactionFactory.cpp Outdated Show resolved Hide resolved
src/zeroD/ReactorNet.cpp Outdated Show resolved Hide resolved
@ischoegl
Copy link
Member Author

@speth ... thanks for the review suggestions! I believe it's all taken care of.

@ischoegl
Copy link
Member Author

This should be it though ...

Copy link
Member

@speth speth 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 to me.

@speth speth merged commit fcff592 into Cantera:main Jan 17, 2022
@ischoegl
Copy link
Member Author

Thanks!!

@ischoegl ischoegl deleted the fix-warnings branch January 17, 2022 21:14
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.

None yet

2 participants