Use std::once_flag and std::call_once for time constant warnings. - #550
Conversation
lukelowry
left a comment
There was a problem hiding this comment.
Thank you, I would have struggled with this.
If I run this on two different cases, will it error on the second case if it raises the same warnings?
I don't see a scenario where we'd get an error, and I am not sure I understand the use-case you're describing, so let try these:
|
Okay that resolves my concern. Thank you sir |
superwhiskers
left a comment
There was a problem hiding this comment.
this looks fine to me
d847882 to
514df62
Compare
Description
This uses
std:once_flagandstd::call_onceto only warn user about the raised time constants once.This removes the excessive warnings for this known issue.
Proposed changes
static void logTimeConstantWarning()to the relevant header files afterTIME_CONSTANT_MINIMUMLog::Warning()call to the static methodstd:once_flagandstd::call_onceat the call site, when the warning is warranted.Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
Will need to better generalize if a similar pattern is needed later.