Flag dependencies on regional settings (in C++)

Can SonarQube flag C++ code constructs that may produce different results depending on the Windows regional settings (such as date and number formats)?

Hi @luc_vermeiren,

We don’t have any rule related to that.

Furthermore, I’m a little puzzled: Respecting the local settings of the user is generally considered as a good thing in terms of UX, so I fail to see what would be the purpose of reporting the use of those constructs. Maybe there are parts of the application where they should not be used, but how would you identify those parts?

Hi Loïc, thanks for replying. The use case is that we are not running on an end user’s local machine, but on a server. So we want the results to be consistent, and sometimes people just change the settings.

Hello again,

I can see the need for such a rule in this context. I created a ticket to record this suggestion. It would be for a rule not enabled by default, but that could be enabled if you’re in the right context.

Of course, this rule has to be prioritized wrt our other tasks.

Thanks!