Replace this call to the non reentrant function "gmtime"


the support was not able to answer this question and asked me to post it here in this forum, maybe someone here is able to give the answer.

Every time if we use the function fmt::gmtime() in our c++ source, we get a code smell about to replace gmtime() by gmtime_r(). This would be correct if we are using the standard library implementation, but here we are using the fmt lib: API Reference — fmt dev documentation

Is this a bug? Or is there a way to adjust that?

Best regards

1 Like


Welcome to the community!

Could you provide a reproducer? I.e. a contained code snippet that demonstrates the problem?

Also, which support are you referring to here?


Hello Ann, this is a typical example:

Hi @to-s ,

Thanks for raising this issue. It is indeed a bug that was identified. You can follow its progress in this ticket.

In the meantime, you can change the value of the setting S1912.nonReentrantFunctionList to avoid raising on localtime and gmtime. Its default value is:
You can change it to remove localtime and gmtime:

I hope this helps.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.