Fix Wmaybe-uninitialized in apps/regression/model/trigonometric_model… #2156
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
….cpp
Fixes these:
apps/regression/model/trigonometric_model.cpp: In member function ‘virtual void Regression::TrigonometricModel::specializedInitCoefficientsForFit(double*, double, Regression::Store*, int) const’:
apps/regression/model/trigonometric_model.cpp:194:40: warning: ‘xMin’ may be used uninitialized [-Wmaybe-uninitialized]
194 | double period = 2.0 * std::fabs(xMax - xMin);
| ~~~~~^~~~~~
apps/regression/model/trigonometric_model.cpp:187:10: note: ‘xMin’ was declared here
187 | double xMin, xMax, yMin, yMax;
| ^~~~
apps/regression/model/trigonometric_model.cpp:194:40: warning: ‘xMax’ may be used uninitialized [-Wmaybe-uninitialized]
194 | double period = 2.0 * std::fabs(xMax - xMin);
| ~~~~~^~~~~~
apps/regression/model/trigonometric_model.cpp:187:16: note: ‘xMax’ was declared here
187 | double xMin, xMax, yMin, yMax;
| ^~~~
apps/regression/model/trigonometric_model.cpp:190:32: warning: ‘yMin’ may be used uninitialized [-Wmaybe-uninitialized]
190 | modelCoefficients[0] = (yMax - yMin) / 2.0;
| ~~~~~~^~~~~~~
apps/regression/model/trigonometric_model.cpp:187:22: note: ‘yMin’ was declared here
187 | double xMin, xMax, yMin, yMax;
| ^~~~
apps/regression/model/trigonometric_model.cpp:190:32: warning: ‘yMax’ may be used uninitialized [-Wmaybe-uninitialized]
190 | modelCoefficients[0] = (yMax - yMin) / 2.0;
| ~~~~~~^~~~~~~
apps/regression/model/trigonometric_model.cpp:187:28: note: ‘yMax’ was declared here
187 | double xMin, xMax, yMin, yMax;
| ^~~~
LD epsilon.bin