-
Notifications
You must be signed in to change notification settings - Fork 9
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
#647 fix format-string type warnings #747
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #747 +/- ##
========================================
Coverage 79.05% 79.05%
========================================
Files 337 337
Lines 10247 10247
========================================
Hits 8101 8101
Misses 2146 2146 |
@@ -144,8 +144,8 @@ void StatsRestartReader::inputStatsFile( | |||
fpos_t pos; | |||
bool finished = false; | |||
while (!finished) { | |||
if (fscanf(pFile, "%zu %c %llu %c %lf", &phaseID, &separator, &elmID, | |||
&separator, &tval) > 0) { | |||
if (fscanf(pFile, "%zu %c %lu %c %lf", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or change ElementIDType to be large enough for llu.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, in this case it might be better to capture to a unsigned long local and convert before use to minimize changes..
958de21
to
2a80eab
Compare
- Ensure types are fully compatible with the format specifier. Some compilers check and generate warnings.
2a80eab
to
586d583
Compare
Some compilers check and generate warnings.
No warnings in GCC7/Clang5/ICC18 for VT or example builds.