-
Notifications
You must be signed in to change notification settings - Fork 41
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
Set LC_NUMERIC=C to avoid issues reading files #120
Conversation
Signed-off-by: ahcorde <[email protected]>
418096a
to
93309f3
Compare
Codecov Report
@@ Coverage Diff @@
## ign-common3 #120 +/- ##
============================================
Coverage 73.99% 74.00%
============================================
Files 69 69
Lines 9433 9435 +2
============================================
+ Hits 6980 6982 +2
Misses 2453 2453
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you write a test to make sure we don't break it and that it works with all platforms? There are some examples here:
@@ -32,7 +33,9 @@ namespace ignition | |||
class IGNITION_COMMON_GRAPHICS_VISIBLE MeshLoader | |||
{ | |||
/// \brief Constructor | |||
public: MeshLoader() = default; | |||
public: MeshLoader() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public: MeshLoader() { | |
public: MeshLoader() | |
{ |
@j-rivero to add tests. |
@@ -32,7 +33,9 @@ namespace ignition | |||
class IGNITION_COMMON_GRAPHICS_VISIBLE MeshLoader | |||
{ | |||
/// \brief Constructor | |||
public: MeshLoader() = default; | |||
public: MeshLoader() { | |||
std::setlocale(LC_NUMERIC, "C"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is influencing the global state of the process in a way that is not documented and may not be ideal for a library. Furthermore, other part of the process can then set again the LC_NUMERIC
to other values, breaking the functionality of the class after it has been created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this is relevant to what you explained here gazebosim/gz-rendering#136, right? So instead of this PR we should try to identify which part of the code is using locale dependent commands and apply changes there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. To be perfectly clear, it is not tragic if this is merged, but I still wanted to raise the point that is not ideal to perturb the global state from a library.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, this is kind of a concerning workaround. It may not break anything as-is, but it's sort of a bad "code smell" that this is necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in one of the meetings, let's decline this PR and try to address the underlying issue instead.
We should address the underlying issue instead. |
Related with this issue gazebosim/gz-rendering#101
Signed-off-by: ahcorde [email protected]