-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
#ifndef IGNITION_COMMON_MESHLOADER_HH_ | ||
#define IGNITION_COMMON_MESHLOADER_HH_ | ||
|
||
#include <clocale> | ||
#include <string> | ||
|
||
#include <ignition/common/graphics/Export.hh> | ||
|
@@ -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 commentThe 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 There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 commentThe 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. |
||
} | ||
|
||
/// \brief Destructor | ||
public: virtual ~MeshLoader() = default; | ||
|
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.