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

#647 fix format-string type warnings #747

Merged
merged 1 commit into from
Apr 8, 2020

Conversation

pnstickne
Copy link
Contributor

@pnstickne pnstickne commented Mar 27, 2020

  • Ensure types are fully compatible with the format specifier.
    Some compilers check and generate warnings.

No warnings in GCC7/Clang5/ICC18 for VT or example builds.

@pnstickne pnstickne requested a review from lifflander March 27, 2020 08:10
@codecov
Copy link

codecov bot commented Mar 27, 2020

Codecov Report

Merging #747 into develop will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff            @@
##           develop     #747   +/-   ##
========================================
  Coverage    79.05%   79.05%           
========================================
  Files          337      337           
  Lines        10247    10247           
========================================
  Hits          8101     8101           
  Misses        2146     2146           

@pnstickne pnstickne changed the title #647 fix trace format-string type warnings #647 fix format-string type warnings Mar 27, 2020
@@ -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",
Copy link
Contributor Author

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.

Copy link
Contributor Author

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..

@lifflander lifflander force-pushed the 647-fix-compiler-warnings branch from 958de21 to 2a80eab Compare April 8, 2020 19:03
- Ensure types are fully compatible with the format specifier.
  Some compilers check and generate warnings.
@lifflander lifflander force-pushed the 647-fix-compiler-warnings branch from 2a80eab to 586d583 Compare April 8, 2020 21:58
@lifflander lifflander merged commit 1277ce4 into develop Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants