Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • sac2c sac2c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 403
    • Issues 403
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • sac-group
  • sac2csac2c
  • Issues
  • #1477
Closed
Open
Created Mar 07, 2006 by Robert Bernecky@rbeDeveloper

strings strangle sac

Bugzilla Link 210
Created on Mar 07, 2006 20:54
Resolution FIXED
Resolved on May 11, 2006 16:10
Version 1.00beta
OS Linux
Architecture PC
Attachments xUTQuadFI.sac, UTQuadFI.sac

Extended Description

1. The attached kills sac2c w/-O3 and -noOPT. 
2..The QUADfi function shows what I think is a good example of
why the semantics of strtod are wrong:
 
I start out with a character vector that I want to convert to
a numeric vector. This requires repeated calls to strtod until
the string is exhausted. Meanwhile...
- I either have to do repeated catenations into the result, 
  as each result element is built, or
- Count the number of transitions from white space to non-white-space
to compute final result size.
- The fact that strtod returns a string means that the termination
test is  0 != strlen(string). If this is like C, it means that the
dumb thing has to iterate over the string looking for the NULL.
This is really really expensive, when you do it N times.
This whole class of functions should really work this way:
- define their behavior so that they're based on character vectors
(or matrices where that's appropriate - not sure I can think of one offhand),
rather tha strings
- Instead of returning a shorter string (as in strtod), return an offset
into the argument where scanning stopped. Thus, the termination condition
becomes: strtodres == shape(strtodarg)[0].
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking