develooper Front page | perl.perl5.porters | Postings from December 2012

instr() now implemented via libc strstr() in blead; somebody mightwant to write Configure probes

From:
Karl Williamson
Date:
December 27, 2012 16:33
Subject:
instr() now implemented via libc strstr() in blead; somebody mightwant to write Configure probes
Message ID:
50DC783F.5030007@khwilliamson.com
commit 5d1d68e202770f3a59cef999bc11d534a2364d5f
  Author: Karl Williamson <public@khwilliamson.com>
  Date:   Mon Dec 24 08:56:22 2012 -0700

      Perl_instr() implement with libc equivalent.

      C89 libc contains the strstr() function that does the same thing as
      instr().  Convert to use it under the assumption that it is faster 
than
      our code, and is less for us to maintain.  Because early versions of
      Lunix libc had a bug when the 'little' argument was NULL (fixed in 
late
      1994), check for that explicitly.  If we were willing to ignore issues
      with such old libc versions, or if we had a Configure probe that 
tested
      for the bug, we could replace the macro instr() completely with a call
      to strstr().

      The memmem() GNU extension does the same thing as Perl_ninstr().  It
      however has bugs in much later libc versions.  A Configure probe could
      be written to see if it is usable.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About