#40693 [NEW]: reimplementation of strtok_r in TSRM/tsrm_strtok_r.c

Ask a Question related to PHP Bugs, Design and Development.

  1. #1

    Default #40693 [NEW]: reimplementation of strtok_r in TSRM/tsrm_strtok_r.c

    From: stefan dot teleman at gmail dot com
    Operating system: Solaris 10
    PHP version: 5.2.1
    PHP Bug Type: Strings related
    Bug description: reimplementation of strtok_r in TSRM/tsrm_strtok_r.c

    Description:
    ------------
    TSRM/tsrm_strtok_r.c reimplements strtok_r(3C) (php-5.2.0 and php-5.2.1).

    Please don't do this on Solaris. There is no reason to reimplement a
    Standard C Library function.

    diff -wu output included below.



    Reproduce code:
    ---------------
    --- tsrm_strtok_r.c.orig 2000-09-11 11:15:29.000000000 -0400
    +++ tsrm_strtok_r.c 2007-03-02 03:25:44.953128000 -0500
    @@ -16,6 +16,9 @@

    char *tsrm_strtok_r(char *s, const char *delim, char **last)
    {
    +#if defined(SOLARIS)
    + return strtok_r(s, delim, last);
    +#else
    char *token;

    if (s == NULL) {
    @@ -41,6 +44,7 @@
    *last = s + 1;
    }
    return token;
    +#endif
    }

    #if 0



    --
    Edit bug report at [url]http://bugs.php.net/?id=40693&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=40693&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=40693&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=40693&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=40693&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=40693&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=40693&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=40693&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=40693&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=40693&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=40693&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=40693&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=40693&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=40693&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=40693&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=40693&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=40693&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=40693&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=40693&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=40693&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=40693&r=mysqlcfg[/url]
    stefan dot teleman at gmail dot com Guest

  2. Similar Questions and Discussions

    1. #40488 [NEW]: Changes to TSRM cause builds to fail under cygwin
      From: phil dot lello at homecall dot co dot uk Operating system: cygwin (WinXP) PHP version: 5.2.1 PHP Bug Type: Compile...
    2. #25445 [Opn->Bgs]: TSRM.h is in tsrm and not in TSRM, where make looks for it
      ID: 25445 Updated by: sniper@php.net Reported By: frank dot finner at ezi dot de -Status: Open +Status: ...
    3. #25445 [NEW]: TSRM.h is in tsrm and not in TSRM, where make looks for it
      From: frank dot finner at ezi dot de Operating system: SuSE Linux 8.2 PHP version: 4.3.3 PHP Bug Type: Compile Failure Bug...
    4. segmentation fault in strtok_r()
      There is a segmentation fault when running the executable of the following code. Please suggest a fix for this. I compiled the code with: "CC...
  3. #2

    Default #40693 [Opn->WFx]: reimplementation of strtok_r in TSRM/tsrm_strtok_r.c

    ID: 40693
    Updated by: [email]helly@php.net[/email]
    Reported By: stefan dot teleman at gmail dot com
    -Status: Open
    +Status: Wont fix
    Bug Type: Strings related
    -Operating System: Solaris 10
    +Operating System: *
    PHP Version: 5.2.1
    New Comment:

    Usually reimplementation of a c library function means that we rely on
    very specific functionality. Otfen in this cases many implementations
    are simply plain wrong. This is true for a bunch of stuff where
    werequire the C99 compliant implementation.


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-02 17:22:40] stefan dot teleman at gmail dot com

    Description:
    ------------
    TSRM/tsrm_strtok_r.c reimplements strtok_r(3C) (php-5.2.0 and
    php-5.2.1).

    Please don't do this on Solaris. There is no reason to reimplement a
    Standard C Library function.

    diff -wu output included below.



    Reproduce code:
    ---------------
    --- tsrm_strtok_r.c.orig 2000-09-11 11:15:29.000000000 -0400
    +++ tsrm_strtok_r.c 2007-03-02 03:25:44.953128000 -0500
    @@ -16,6 +16,9 @@

    char *tsrm_strtok_r(char *s, const char *delim, char **last)
    {
    +#if defined(SOLARIS)
    + return strtok_r(s, delim, last);
    +#else
    char *token;

    if (s == NULL) {
    @@ -41,6 +44,7 @@
    *last = s + 1;
    }
    return token;
    +#endif
    }

    #if 0




    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40693&edit=1[/url]
    helly@php.net Guest

  4. #3

    Default #40693 [WFx]: reimplementation of strtok_r in TSRM/tsrm_strtok_r.c

    ID: 40693
    User updated by: stefan dot teleman at gmail dot com
    Reported By: stefan dot teleman at gmail dot com
    Status: Wont fix
    Bug Type: Strings related
    Operating System: *
    PHP Version: 5.2.1
    New Comment:

    Exactly what features or specific functionality does your strtok_r
    provide that strtok_r implementations from Solaris or Linux or BSD or
    Windows do not ?

    None.

    If you have identified a bug in any of these implementations of
    strtok_r(3C), please identify the bug.

    Duplicating Standard C Library all over the place just because "it
    doesn't crash anymore if I do this" is not really a valid
    justification.

    Thank you.

    Stefan Teleman


    Previous Comments:
    ------------------------------------------------------------------------

    [2007-03-02 19:58:11] [email]helly@php.net[/email]

    Usually reimplementation of a c library function means that we rely on
    very specific functionality. Otfen in this cases many implementations
    are simply plain wrong. This is true for a bunch of stuff where
    werequire the C99 compliant implementation.

    ------------------------------------------------------------------------

    [2007-03-02 17:22:40] stefan dot teleman at gmail dot com

    Description:
    ------------
    TSRM/tsrm_strtok_r.c reimplements strtok_r(3C) (php-5.2.0 and
    php-5.2.1).

    Please don't do this on Solaris. There is no reason to reimplement a
    Standard C Library function.

    diff -wu output included below.



    Reproduce code:
    ---------------
    --- tsrm_strtok_r.c.orig 2000-09-11 11:15:29.000000000 -0400
    +++ tsrm_strtok_r.c 2007-03-02 03:25:44.953128000 -0500
    @@ -16,6 +16,9 @@

    char *tsrm_strtok_r(char *s, const char *delim, char **last)
    {
    +#if defined(SOLARIS)
    + return strtok_r(s, delim, last);
    +#else
    char *token;

    if (s == NULL) {
    @@ -41,6 +44,7 @@
    *last = s + 1;
    }
    return token;
    +#endif
    }

    #if 0




    ------------------------------------------------------------------------


    --
    Edit this bug report at [url]http://bugs.php.net/?id=40693&edit=1[/url]
    stefan dot teleman at gmail dot com Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139