In perl.git, the branch blead has been updated <https://perl5.git.perl.org/perl.git/commitdiff/0be0ef8f515958d475928ee7f95d06eb27ed16e8?hp=78342678c3d43495ec0526969486d748b07f0525>
- Log ----------------------------------------------------------------- commit 0be0ef8f515958d475928ee7f95d06eb27ed16e8 Author: Karl Williamson <[email protected]> Date: Tue Jun 4 12:31:03 2019 -0600 White space only in comment commit a5bc07423c0a05b955b43bbc4acf868b0b905e31 Author: Karl Williamson <[email protected]> Date: Wed Jun 5 11:15:51 2019 -0600 regcomp.sym: Change regnode description Simplify the description for ANYOFb commit 3167cd977ff2111c94c27b02b916ed58e14f281f Author: Richard Leach <[email protected]> Date: Sun May 19 03:34:38 2019 +0000 Additional Net-Ping tests skip if d_getpbyname is undef commit f1d63d3c9399eb3b51a808574f055fa1b2b57979 Author: Richard Leach <[email protected]> Date: Sun May 19 03:27:56 2019 +0000 Tests for Android stub functions updated for Oreo ----------------------------------------------------------------------- Summary of changes: dist/Net-Ping/t/001_new.t | 5 ++++ dist/Net-Ping/t/010_pingecho.t | 5 ++++ hints/linux-android.sh | 56 +++++++++++++++++++++++++++++++++++------- pod/perldebguts.pod | 3 +-- regcomp.c | 4 +-- regcomp.sym | 2 +- regnodes.h | 2 +- 7 files changed, 62 insertions(+), 15 deletions(-) diff --git a/dist/Net-Ping/t/001_new.t b/dist/Net-Ping/t/001_new.t index 6b097d70a8..46965b7b05 100644 --- a/dist/Net-Ping/t/001_new.t +++ b/dist/Net-Ping/t/001_new.t @@ -1,11 +1,16 @@ use warnings; use strict; +use Config; BEGIN { unless (my $port = getservbyname('echo', 'tcp')) { print "1..0 \# Skip: no echo port\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More qw(no_plan); diff --git a/dist/Net-Ping/t/010_pingecho.t b/dist/Net-Ping/t/010_pingecho.t index 90a934a0b1..e8a6bb093e 100644 --- a/dist/Net-Ping/t/010_pingecho.t +++ b/dist/Net-Ping/t/010_pingecho.t @@ -1,11 +1,16 @@ use warnings; use strict; +use Config; BEGIN { unless (my $port = getservbyname('echo', 'tcp')) { print "1..0 \# Skip: no echo port\n"; exit; } + unless ($Config{d_getpbyname}) { + print "1..0 \# Skip: no getprotobyname\n"; + exit; + } } use Test::More tests => 2; diff --git a/hints/linux-android.sh b/hints/linux-android.sh index 9f7196fc43..cd22876662 100644 --- a/hints/linux-android.sh +++ b/hints/linux-android.sh @@ -43,27 +43,37 @@ libswanted="$libswanted m log" # https://code.google.com/p/android-source-browsing/source/browse/libc/netbsd/net/getservent_r.c?repo=platform--bionic&r=ca6fe7bebe3cc6ed7e2db5a3ede2de0fcddf411d#95 d_getservent_r='undef' -# Bionic defines several stubs that just warn and return NULL +# Bionic defines several stubs that warn (in older releases) and return NULL # https://gitorious.org/0xdroid/bionic/blobs/70b2ef0ec89a9c9d4c2d4bcab728a0e72bafb18e/libc/bionic/stubs.c # https://android.googlesource.com/platform/bionic/+/master/libc/bionic/stubs.cpp -# If they warn with 'FIX' or 'Android', assume they are the stubs -# we want to avoid. +# These tests originally looked for 'FIX' or 'Android' warnings, as they +# indicated stubs to avoid. At some point, Android stopped emitting +# those warnings; the tests were adapted to check function return values +# and hopefully now detect stubs on both older and newer Androids. # These are all stubs as well, but the core doesn't use them: # getusershell setusershell endusershell # This script UU/archname.cbu will get 'called-back' by Configure. $cat > UU/archname.cbu <<'EOCBU' -# egrep pattern to detect a stub warning on Android. +# original egrep pattern to detect a stub warning on Android. # Right now we're checking for: # Android 2.x: FIX ME! implement FUNC # Android 4.x: FUNC is not implemented on Android +# Android 8.x: <no warnings; tests now printf a compatible warning> android_stub='FIX|Android' $cat > try.c << 'EOM' #include <netdb.h> -int main() { (void) getnetbyname("foo"); return(0); } +#include <stdio.h> +int main() { + struct netent* test = getnetbyname("loopback"); + if (test == NULL) { + printf("getnetbyname is still a stub function on Android"); + } + return(0); +} EOM $cc $ccflags try.c -o try android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` @@ -73,7 +83,14 @@ fi $cat > try.c << 'EOM' #include <netdb.h> -int main() { (void) getnetbyaddr((uint32_t)1, AF_INET); return(0); } +#include <stdio.h> +int main() { + struct netent* test = getnetbyaddr(127, AF_INET); + if (test == NULL) { + printf("getnetbyaddr is still a stub function on Android"); + } + return(0); +} EOM $cc $ccflags try.c -o try android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` @@ -95,7 +112,14 @@ fi $cat > try.c << 'EOM' #include <netdb.h> -int main() { (void) getprotobyname("foo"); return(0); } +#include <stdio.h> +int main() { + struct protoent* test = getprotobyname("tcp"); + if (test == NULL) { + printf("getprotobyname is still a stub function on Android"); + } + return(0); +} EOM $cc $ccflags try.c -o try android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` @@ -105,7 +129,14 @@ fi $cat > try.c << 'EOM' #include <netdb.h> -int main() { (void) getprotobynumber(1); return(0); } +#include <stdio.h> +int main() { + struct protoent* test = getprotobynumber(1); + if (test == NULL) { + printf("getprotobynumber is still a stub function on Android"); + } + return(0); +} EOM $cc $ccflags try.c -o try android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` @@ -126,7 +157,14 @@ fi $cat > try.c << 'EOM' #include <unistd.h> -int main() { (void) ttyname(STDIN_FILENO); return(0); } +#include <stdio.h> +int main() { + char *tty = ttyname(STDIN_FILENO); + if (tty == NULL) { + printf("ttyname is still a stub function on Android"); + } + return(0); +} EOM $cc $ccflags try.c -o try android_warn=`$run ./try 2>&1 | $egrep "$android_stub"` diff --git a/pod/perldebguts.pod b/pod/perldebguts.pod index 8430e2759f..9eafdbd26e 100644 --- a/pod/perldebguts.pod +++ b/pod/perldebguts.pod @@ -614,8 +614,7 @@ will be lost. ANYOFH sv 1 Like ANYOF, but only has "High" matches, none in the bitmap; ANYOFHb sv 1 Like ANYOFH, but all matches share the same - first byte, the repurposed flags field - contains it + UTF-8 start byte, given in the flags field ANYOFM byte 1 Like ANYOF, but matches an invariant byte as determined by the mask and arg NANYOFM byte 1 complement of ANYOFM diff --git a/regcomp.c b/regcomp.c index 5068a0a1a2..d2267742ab 100644 --- a/regcomp.c +++ b/regcomp.c @@ -19017,8 +19017,8 @@ S_regclass(pTHX_ RExC_state_t *pRExC_state, I32 *flagp, U32 depth, SvREFCNT_dec(intersection); } - /* If didn't find an optimization and there is no need for a - * bitmap, optimize to indicate that */ + /* If didn't find an optimization and there is no need for a bitmap, + * optimize to indicate that */ if ( start[0] >= NUM_ANYOF_CODE_POINTS && ! LOC && ! upper_latin1_only_utf8_matches diff --git a/regcomp.sym b/regcomp.sym index b702c437a1..e432ae5cd1 100644 --- a/regcomp.sym +++ b/regcomp.sym @@ -63,7 +63,7 @@ ANYOFD ANYOF, sv charclass S ; Like ANYOF, but /d is in effect ANYOFL ANYOF, sv charclass S ; Like ANYOF, but /l is in effect ANYOFPOSIXL ANYOF, sv charclass_posixl S ; Like ANYOFL, but matches [[:posix:]] classes ANYOFH ANYOF, sv 1 S ; Like ANYOF, but only has "High" matches, none in the bitmap; -ANYOFHb ANYOF, sv 1 S ; Like ANYOFH, but all matches share the same first byte, the repurposed flags field contains it +ANYOFHb ANYOF, sv 1 S ; Like ANYOFH, but all matches share the same UTF-8 start byte, given in the flags field ANYOFM ANYOFM byte 1 S ; Like ANYOF, but matches an invariant byte as determined by the mask and arg NANYOFM ANYOFM byte 1 S ; complement of ANYOFM diff --git a/regnodes.h b/regnodes.h index add19473a1..487b6c2dee 100644 --- a/regnodes.h +++ b/regnodes.h @@ -34,7 +34,7 @@ #define ANYOFL 20 /* 0x14 Like ANYOF, but /l is in effect */ #define ANYOFPOSIXL 21 /* 0x15 Like ANYOFL, but matches [[:posix:]] classes */ #define ANYOFH 22 /* 0x16 Like ANYOF, but only has "High" matches, none in the bitmap; */ -#define ANYOFHb 23 /* 0x17 Like ANYOFH, but all matches share the same first byte, the repurposed flags field contains it */ +#define ANYOFHb 23 /* 0x17 Like ANYOFH, but all matches share the same UTF-8 start byte, given in the flags field */ #define ANYOFM 24 /* 0x18 Like ANYOF, but matches an invariant byte as determined by the mask and arg */ #define NANYOFM 25 /* 0x19 complement of ANYOFM */ #define POSIXD 26 /* 0x1a Some [[:class:]] under /d; the FLAGS field gives which one */ -- Perl5 Master Repository
