{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/dmlc-core/issues/323","repository_url":"https://api.github.com/repos/dmlc/dmlc-core","labels_url":"https://api.github.com/repos/dmlc/dmlc-core/issues/323/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/dmlc-core/issues/323/comments","events_url":"https://api.github.com/repos/dmlc/dmlc-core/issues/323/events","html_url":"https://github.com/dmlc/dmlc-core/issues/323","id":270042398,"number":323,"title":"FieldEntry<float> on g++5.4","user":{"login":"superbobry","id":185856,"avatar_url":"https://avatars1.githubusercontent.com/u/185856?v=4","gravatar_id":"","url":"https://api.github.com/users/superbobry","html_url":"https://github.com/superbobry","followers_url":"https://api.github.com/users/superbobry/followers","following_url":"https://api.github.com/users/superbobry/following{/other_user}","gists_url":"https://api.github.com/users/superbobry/gists{/gist_id}","starred_url":"https://api.github.com/users/superbobry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superbobry/subscriptions","organizations_url":"https://api.github.com/users/superbobry/orgs","repos_url":"https://api.github.com/users/superbobry/repos","events_url":"https://api.github.com/users/superbobry/events{/privacy}","received_events_url":"https://api.github.com/users/superbobry/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-10-31T17:10:27Z","updated_at":"2017-11-29T20:59:52Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"While debugging dmlc/xgboost#2417 I came across a peculiar bug in `std:stof` which, when compiled on Linux with g++5.4, return 0 for `\"0.5\"`. Interestingly, a simple example outside of XGBoost codebase does not trigger the bug, so I suspect it is caused by some specific combination of flags... wdyt?\r\n\r\n```diff\r\ndiff --git a/include/dmlc/parameter.h b/include/dmlc/parameter.h\r\nindex 73c2b9e..9477bf3 100644\r\n--- a/include/dmlc/parameter.h\r\n+++ b/include/dmlc/parameter.h\r\n@@ -958,6 +958,7 @@ class FieldEntry<float> : public FieldEntryNumeric<FieldEntry<float>, float> {\r\n   typedef FieldEntryNumeric<FieldEntry<float>, float> Parent;\r\n   // override set\r\n   virtual void Set(void *head, const std::string &value) const {\r\n+   std::cout << (float) std::stof(\"0.5\") << std::endl;\r\n     try {\r\n       this->Get(head) = std::stof(value);\r\n     } catch (const std::invalid_argument &) {\r\n```\r\n```\r\n$ g++ --version\r\ng++ (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609\r\nCopyright (C) 2015 Free Software Foundation, Inc.\r\nThis is free software; see the source for copying conditions.  There is NO\r\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\r\n```"},"comment":{"url":"https://api.github.com/repos/dmlc/dmlc-core/issues/comments/347994487","html_url":"https://github.com/dmlc/dmlc-core/issues/323#issuecomment-347994487","issue_url":"https://api.github.com/repos/dmlc/dmlc-core/issues/323","id":347994487,"user":{"login":"superbobry","id":185856,"avatar_url":"https://avatars1.githubusercontent.com/u/185856?v=4","gravatar_id":"","url":"https://api.github.com/users/superbobry","html_url":"https://github.com/superbobry","followers_url":"https://api.github.com/users/superbobry/followers","following_url":"https://api.github.com/users/superbobry/following{/other_user}","gists_url":"https://api.github.com/users/superbobry/gists{/gist_id}","starred_url":"https://api.github.com/users/superbobry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/superbobry/subscriptions","organizations_url":"https://api.github.com/users/superbobry/orgs","repos_url":"https://api.github.com/users/superbobry/repos","events_url":"https://api.github.com/users/superbobry/events{/privacy}","received_events_url":"https://api.github.com/users/superbobry/received_events","type":"User","site_admin":false},"created_at":"2017-11-29T20:59:52Z","updated_at":"2017-11-29T20:59:52Z","author_association":"CONTRIBUTOR","body":"Note: I never got to check this hypothesis, but the issue could be related to locale settings."}}
{"actor":{"display_login":"superbobry"}}