Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8c6e7723a05839aef6fc9235c17dedcf92fd4d55
Ticket: 1976981fffffffffffffffffffffffffffffffff
-Dstrtod doesn't do what is expected.
User & Date: seebs on 2008-05-28 18:03:21
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    The use of -Dstrtod=fixstrtod is not reliable.  When glibc's headers are read, the inline definition of strtod in terms of __internal_strtod is modified by the macro.  So, while every call to strtod() is replaced with a call to fixstrtod(), that refers to an inline function, and the library's standard __internal_strtod() is called anyway.  If the configure script's test to determine that it needs to modify strtod is correct, it is having no effect in the default configuration of glibc.
    
    In general, C does not really "allow" redefinitions of standard library functions.  Obviously, there is a compelling reason to try to outsmart the library in this case.
    
    The correct way to do this is to, *AFTER* including the standard headers, execute code something like this:
    
    #ifdef USE_FIXSTRTOD
    extern double fixstrtod(const char *, char **);
    #undef strtod
    #define strtod fixstrtod
    #endif
    
    This is still probably undefined behavior, but I'm pretty confident that it will work.
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "seebs"
  10. subsystem changed to: "53. Configuration and Build Tools"
  11. title changed to: "-Dstrtod doesn't do what is expected."
  12. type changed to: "Bug"