Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 381
    • Issues 381
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 14
    • Merge requests 14
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #537

Closed
Open
Created Jul 18, 2017 by Mark Olesen@markMaintainer

potential locale issues with readScalar

We currently have two forms of readScalar. One that uses Istream/token and the second that uses strtof or strtod internally. Both strtof and strtod are apparently locale-dependent (cf, http://www.cplusplus.com/reference/cstdlib/strtod/).

Although it doesn't help with locale, but could also consider using the newer std::stof or std::stod instead, since these work with std::string directly. In any case, it would be nice to reduce the number of places with this type of code:

readScalar(IStringStream(str)());

We could quite reasonable either bury the IStringStream inside, or equivalent, so that we could simply use

readScalar(str);
Edited Jul 18, 2017 by Mark Olesen
Assignee
Assign to
Time tracking