Skip to content
Tcl Source Code History Of Ticket 1902648fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1902648fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1902648fffffffffffffffffffffffffffffffff

  1. Ticket change [e4d416c565] (rid 88026) by jenglish on 2008-02-27 01:45:46:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Found this when trying to build Tcl 8.5.1 on an ancient Unix (AIX 4.1):
      
      Tcl 8.5.1 calls strcasecmp() in a few places, and it really should not.  strcasecmp is nonportable (it's not part of C89 -- with good reason).
      
      FTBFS errors on AIX 4.1 attached.
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.5.1"
    5. is_private initialized to: "0"
    6. priority initialized to: "3 Low"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "jenglish"
    10. subsystem initialized to: "52. Portability Support"
    11. title initialized to: "Do not use strcasecmp"
    12. type initialized to: "Bug"
  2. Ticket change [45f34f5d2c] (rid 99433) by jenglish on 2008-02-27 08:45:47:

    1. icomment:
      
      
      File Added - 268199: ftbfs.errs
      
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  3. Ticket change [ac04219c70] (rid 101222) by jenglish on 2008-02-27 09:13:26:

    1. icomment:
      Logged In: YES 
      user_id=68433
      Originator: YES
      
      More info:
      
      There is a fallback implementation of strcasecmp and strncasecmp in compat/strncasecmp.c; however the autoconf logic to enable it is not being triggered on this platform.
      
      AIX 4.1 has strcasecmp; it's defined in libc.a, and declared in <strings.h> along with a few other BSDisms like bcmp/bcopy/bzero, index, and rindex.  
      
      Adding:
      
      #if HAVE_STRINGS_H
      #  include <strings.h>
      #endif
      
      to unix/tclUnixPort.h fixes the compile-time errors, and there are no subsequent link-time errors.
      
      <strings.h> is in neither C89 nor POSIX, but it is specified in the Open Group Single Unix Specification.
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  4. Ticket change [7bfcd92b03] (rid 97000) by jenglish on 2008-02-27 09:53:46:

    1. icomment:
      
      
      File Deleted - 268199: 
      
      Logged In: YES 
      user_id=68433
      Originator: YES
      
      strcasecmp is called in the following places in Tcl 8.5.1
      
      + In the implementation of [lsort -nocase], [switch -nocase], [lsearch -nocase], and [lsearch -sorted -nocase]
      
      All of these uses were introduced by TIP#241.  The TIP does not specify whether "case-insensitive" means "ASCII-only", "locale-dependent", "UTF-aware but still ASCII-only", "according to one of the standardized Unicode normalization forms", or "what Tcl does elsewhere".  Presumably "what Tcl does elsewhere" (e.g., Tcl_StringCaseMatch, Tcl_UniCharToLower) is the most sensible.  strcasecmp() will typically be locale-dependent (or ASCII-only, which amounts to the same thing).  In any event, strcasecmp() is incorrect here, and causes portability problems.  This should be fixed.
      
      + In the definition of TclpInitLibraryPath().  This call was introduced 1999-04-15 <stanton> with the log message "merged tcl 8.1 branch back into the main trunk"; further details are lost to history.  It is not immediately clear to me why TclpInitLibraryPath is doing a case-insensitive comparison at this point, or indeed what it is doing at all.
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  5. Ticket change [fbbc80ee94] (rid 92119) by jenglish on 2008-02-29 04:47:47:

    1. icomment:
      Logged In: YES 
      user_id=68433
      Originator: YES
      
      See also #1236896 "make -nocase behave correct with non-ASCII characters".  That would take care of the first batch of calls.
      
      Tracked the introduction of the strcasecmp() call in unix/tclUnixInit.c back to another jumbo patch; 
      Committer: stanton <stanton>  1998-09-21 16:39:52
      Changelog entry just says "Added contents of Tcl 8.1a2".  Sigh.
      
      It looks like it might be related to early Mac OS support.
      
      
      
      
    2. login: "jenglish"
    3. mimetype: "text/plain"
    4. username: "jenglish"
  6. Ticket change [a0c1a2ce65] (rid 96865) by rkeene on 2010-09-15 05:56:49:

    1. icomment:
      When using Diet Libc (<http://www.fefe.de/dietlibc/>), Tcl fails to build with complaints regarding strcasecmp.  Adding "#include <strings.h>" in generic/tclInt.h with the existing "#include <string.h>" fixes the issue and Tcl compiles cleanly.
      
      
    2. login: "rkeene"
    3. mimetype: "text/plain"
    4. username: "rkeene"