This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Karl Williamson [Sat, 21 Oct 2017 23:24:11 +0000 (17:24 -0600)]
regcomp.c: Add assertion
If this value is negative, something is wrong.
Dagfinn Ilmari Mannsåker [Sun, 15 Oct 2017 07:33:22 +0000 (09:33 +0200)]
Fix sv_vcatpvfn %s with precision on non-NUL-terminated strings
The precision parameter to %s can be used to print non-NUL-terminated
strings, so use my_strnlen() to limit the length checking to the
specified length.
Dagfinn Ilmari Mannsåker [Sat, 21 Oct 2017 19:05:17 +0000 (20:05 +0100)]
Provide fallback strnlen implementation
Dagfinn Ilmari Mannsåker [Sat, 21 Oct 2017 19:04:37 +0000 (20:04 +0100)]
Probe for strnlen on VMS
H.Merijn Brand [Sat, 21 Oct 2017 17:54:17 +0000 (19:54 +0200)]
Regenerate Glossary
Karl Williamson [Sat, 21 Oct 2017 17:12:20 +0000 (11:12 -0600)]
Fix Perl_langinfo() non-threaded bug
Perl_langinfo() is supposed to return a pointer to internal storage that
is supposed to remain valid until the next call to it. That should come
automatically on single-threaded perls. The previous version took
advantage of this to avoid copying the result to a buffer, and just
called plain nl_langinfo(). However, it turns out that some systems
destroy the internal space also when a setlocale() is done. That means
the result must be copied in all instances.
Aaron Crane [Sat, 21 Oct 2017 16:05:11 +0000 (17:05 +0100)]
[MERGE] Rely on a C89 compiler
We have claimed to need a C89 compiler for building since at least October 1998
(see commit
5effff0b18af479fcc5e67b74bc41c4bc53342f6). This branch finally
makes good on that promise: we no longer probe for required features of C89
(whether language features, cpp syntax, the presence or behaviour of library
routines, or the availability or contents of header files).
This permits substantial simplification of our header files, as well as
a pleasing reduction in the size of the Configure script and the number of
compilation probes it does.
That said, this set of changes is a little conservative. Notably, I have not
attempted to unpick our maze of malloc/free/realloc macros to rely on things
like free(NULL); nor have I attempted to rely on adequate locale support (since
AIUI the libc on Android in particular claims to have locale support but
doesn't). It's also possible that I've simply missed some opportunities to
simplify the code and/or Configure script, but I hope that we can collectively
fix those as and when we discover them.
These changes have been tested on the following platforms: Mac OS (gcc, clang),
Linux (gcc), FreeBSD (gcc), Win32 (MSVC), HP/UX (HP C), and AIX (xlc).
This work was undertaken at the Perl 5 Hackathon 2017. I thank the Hackathon's
sponsors for making it possible for me to attend; I would not have been able to
do this otherwise.
Aaron Crane [Wed, 18 Oct 2017 18:34:45 +0000 (19:34 +0100)]
perl.h: explicitly declare "environ" in more places
Some systems declare environ in some situations; others never do. (BSD
systems seem to fall into the latter category, for example.)
Previously, we declared environ in the absence of the DONT_DECLARE_STD cpp
symbol, but that symbol has now been removed (on the grounds that redeclaring
system functions is typically unhelpful). But it probably shouldn't have been
used to avoid declaring environ, because very few systems actually provide
declarations for that variable.
This change adds the environ declaration almost everywhere, on the grounds
that even where the system headers do declare it, an additional declaration
won't in fact hurt.
Aaron Crane [Tue, 17 Oct 2017 16:36:33 +0000 (17:36 +0100)]
pod/perlhacktips.pod: remove some outdated portability notes
Aaron Crane [Sat, 14 Oct 2017 14:26:48 +0000 (16:26 +0200)]
Rely on C89 <string.h>
This requires a corresponding change in the metaconfig units.
Aaron Crane [Sat, 14 Oct 2017 14:10:31 +0000 (16:10 +0200)]
Don't attempt to use non-standard <memory.h>
It's only needed on systems without C89 <string.h>, which we rely on anyway.
Aaron Crane [Sat, 14 Oct 2017 13:47:10 +0000 (15:47 +0200)]
Rely on C89 <assert.h>
Aaron Crane [Sat, 14 Oct 2017 13:20:33 +0000 (15:20 +0200)]
Rely on C89 <math.h>
This requires a corresponding change in the metaconfig units.
Aaron Crane [Sat, 14 Oct 2017 13:11:22 +0000 (15:11 +0200)]
Never attempt to redeclare standard functions
Aaron Crane [Sat, 14 Oct 2017 12:43:38 +0000 (14:43 +0200)]
Don't attempt to define or use STANDARD_C
We rely on a C89 implementation anyway.
Aaron Crane [Sat, 14 Oct 2017 12:39:07 +0000 (14:39 +0200)]
Rely on C89 NULL
Aaron Crane [Sat, 14 Oct 2017 12:03:01 +0000 (14:03 +0200)]
Don't declare C89 realloc()
The declaration is actually for PerlMem_realloc(), which is a macro for
either realloc() or an indirection through the interpreter struct, depending
on configuration — see iperlsys.h. If it's the indrection, this declaration
will be a syntax error, so it must be in fact plain old realloc().
The declaration is guarded with HAS_REALLOC_PROTOTYPE, which isn't actually
defined or consulted anywhere else in the codebase.
Since we require C89, there's no need for this — we #include <stdlib.h>, and
therefore can assume realloc() exists.
Aaron Crane [Sat, 14 Oct 2017 09:57:51 +0000 (11:57 +0200)]
Rely on C89 strerror()
This requires a corresponding change to the metaconfig units.
Aaron Crane [Sat, 14 Oct 2017 09:15:04 +0000 (11:15 +0200)]
util.h: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 09:09:26 +0000 (11:09 +0200)]
util.c: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 08:56:37 +0000 (10:56 +0200)]
thread.h: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 08:52:05 +0000 (10:52 +0200)]
sv.c: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 08:48:10 +0000 (10:48 +0200)]
regen/reentr.pl: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 08:42:16 +0000 (10:42 +0200)]
pp_sys.c: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 08:07:18 +0000 (10:07 +0200)]
pp_pack.c: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 07:55:26 +0000 (09:55 +0200)]
pp_hot.c: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 07:53:41 +0000 (09:53 +0200)]
pp_ctl.c: simplify cpp conditionals
Aaron Crane [Sat, 14 Oct 2017 07:51:50 +0000 (09:51 +0200)]
pp.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 16:16:16 +0000 (18:16 +0200)]
perlio.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 16:11:58 +0000 (18:11 +0200)]
perl.h: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 15:42:54 +0000 (17:42 +0200)]
Drop support for the hp9000s500 cpp symbol
This includes changed metaconfig units which drop support in the same way.
https://en.wikipedia.org/wiki/HP_9000 :
> The HP 9000 brand was introduced in 1984 to encompass several existing
> technical workstation models previously launched in the early 1980s. […]
> The Series 500s were based on the HP FOCUS microprocessor. […] The 520 was
> a complete workstation with built-in keyboard, display, 5.25-inch floppy
> disk, and optional thermal printer and 5 MB hard disk. […] The processors
> in the original Series 500s ran at 20 MHz, and could reach a benchmark
> speed of 1 MIPS.
https://en.wikipedia.org/wiki/HP_FOCUS :
> The Hewlett-Packard FOCUS microprocessor, launched in 1982, was the
> first commercial, single chip, fully 32-bit microprocessor available on
> the market. […] The FOCUS […] was a stack architecture, with over 220
> instructions (some 32 bits wide, some 16 bits wide), a segmented memory
> model, and no general purpose programmer-visible registers.
Aaron Crane [Fri, 13 Oct 2017 15:24:42 +0000 (17:24 +0200)]
Delete useless references to DG/UX
Aaron Crane [Fri, 13 Oct 2017 15:17:15 +0000 (17:17 +0200)]
perl.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 15:07:13 +0000 (17:07 +0200)]
opcode.pl: simplify cpp conditionals
This affects the generated opcode.h.
Aaron Crane [Fri, 13 Oct 2017 15:03:32 +0000 (17:03 +0200)]
numeric.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 15:02:25 +0000 (17:02 +0200)]
mg.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 14:55:55 +0000 (16:55 +0200)]
malloc.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 14:54:44 +0000 (16:54 +0200)]
malloc.c: don't redefine START_EXTERN_C from perl.h
Aaron Crane [Fri, 13 Oct 2017 14:44:08 +0000 (16:44 +0200)]
handy.h: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 14:40:59 +0000 (16:40 +0200)]
dosish.h: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 14:34:23 +0000 (16:34 +0200)]
EXTERN.h: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 14:30:05 +0000 (16:30 +0200)]
doio.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 14:20:21 +0000 (16:20 +0200)]
vms/vmsish.h: move a function declaration from doio.c
Aaron Crane [Fri, 13 Oct 2017 13:59:59 +0000 (15:59 +0200)]
caretx.c: simplify cpp conditionals
Aaron Crane [Fri, 13 Oct 2017 13:56:07 +0000 (15:56 +0200)]
XSUB.h: simplify cpp conditions using C89 "#elif"
Aaron Crane [Sat, 14 Oct 2017 07:45:18 +0000 (09:45 +0200)]
Rely on contents of C89 <limits.h>
Aaron Crane [Fri, 13 Oct 2017 13:34:03 +0000 (15:34 +0200)]
Simplify perl.h floating-point limits defines
- Always include <float.h> and <limits.h>
- Assume that the DBL_* constants are always available in <float.h> (though
we still check for each LDBL_* constant individually)
- Drop support for the undocumented OVR_DBL_DIG and OVR_LDBL_DIG
preprocessor symbols
- Use cpp "#elif"
Aaron Crane [Fri, 13 Oct 2017 13:14:20 +0000 (15:14 +0200)]
Don't try to use <values.h>
All the information it contains can be gleaned more readily from C89
<limits.h> and <float.h>.
Aaron Crane [Fri, 13 Oct 2017 11:54:42 +0000 (13:54 +0200)]
Rely on C89 <float.h> defining DBL_DIG
I would like to be able to assume that we have long doubles, and therefore
that LDBL_DIG and friends are all defined too. But it seems that we may
still support some platforms which are otherwise C89, but don't have even
trivial long-double support; in particular, HP/UX 10 apparently uses a
struct of four uint32_t values as long double, but doesn't support other
bits, and confuses the Configure probe that looks for quadmath.
Aaron Crane [Fri, 13 Oct 2017 10:49:41 +0000 (12:49 +0200)]
Rely on C89 <float.h>
This requires newer metaconfig units that also rely on C89 <float.h>.
Aaron Crane [Fri, 13 Oct 2017 10:38:59 +0000 (12:38 +0200)]
Rely on C89 <limits.h>
This requires newer metaconfig units that also rely on C89 <limits.h>.
Aaron Crane [Fri, 13 Oct 2017 09:18:10 +0000 (11:18 +0200)]
Rely on C89 <time.h>
The Configure script here was built from a metaconfig unit that also assumes
<time.h> exists.
Aaron Crane [Fri, 13 Oct 2017 08:35:44 +0000 (10:35 +0200)]
Rely on C89 strchr() and strrchr()
This needs a metaconfig change that defangs the standard unit for finding
strchr(), because that unit sees the uses of "index" and "rindex" (in files
like keywords.c and opcode.h) as indicators that it must be used instead.
Aaron Crane [Fri, 13 Oct 2017 08:03:59 +0000 (10:03 +0200)]
Rely on C89 sprintf() return value semantics
Aaron Crane [Tue, 17 Oct 2017 16:30:18 +0000 (17:30 +0100)]
Use snprintf() in favour of sprintf()
Aaron Crane [Fri, 13 Oct 2017 07:25:14 +0000 (09:25 +0200)]
Rely on C89 <stddef.h>
Aaron Crane [Fri, 13 Oct 2017 07:16:17 +0000 (09:16 +0200)]
Rely on C89 <stdlib.h>
The Configure changes here were generated using a version of metaconfig
that copies U/modified/i_stdlib.U from dist/U/vaproto.U, and changes it to
unconditionally define the i_stdlib Configure variable. That variable is
used by a large number of other Configure units, so it's not actually
practical to try and remove the relevant unit entirely.
Aaron Crane [Thu, 12 Oct 2017 22:55:41 +0000 (00:55 +0200)]
Rely on C89 <stdarg.h>
Aaron Crane [Thu, 12 Oct 2017 16:50:15 +0000 (18:50 +0200)]
Rely on C89 prototypes
The Configure changes here were generated using a version of metaconfig
that modifies the prototype.U and Protochk.U units to assume that C89
prototypes work.
Aaron Crane [Sat, 14 Oct 2017 15:01:19 +0000 (17:01 +0200)]
Don't pretend to determine whether ansi2knr is needed
Aaron Crane [Thu, 12 Oct 2017 16:17:02 +0000 (18:17 +0200)]
Rely on C89 variadic prototypes
The Configure changes here were generated using a version of metaconfig
that copies U/modified/vaproto.U from dist/U/vaproto.U, and changes it to
refrain from promising to define a _V symbol (which would otherwise cause
the relevant probe to included in Configure).
Aaron Crane [Thu, 12 Oct 2017 16:05:57 +0000 (18:05 +0200)]
Configure: assume C89 headers in need_va_copy probe
This matches a recent change to metaconfig.
Aaron Crane [Thu, 12 Oct 2017 15:56:12 +0000 (17:56 +0200)]
Rely on C89 vprintf()
Aaron Crane [Thu, 12 Oct 2017 15:49:34 +0000 (17:49 +0200)]
Rely on C89 sprintf() return type
Aaron Crane [Thu, 12 Oct 2017 15:44:29 +0000 (17:44 +0200)]
Configure: assume C89 headers in d_c99_variadic_macros probe
This matches a recent change to metaconfig.
Aaron Crane [Thu, 12 Oct 2017 15:35:52 +0000 (17:35 +0200)]
Rely on C89 snprintf()
Aaron Crane [Thu, 12 Oct 2017 15:22:43 +0000 (17:22 +0200)]
Rely on C89 vsnprintf()
We assume it has the standard behaviour that, if the buffer is too short, it
returns the desired buffer length.
Aaron Crane [Thu, 12 Oct 2017 14:26:56 +0000 (16:26 +0200)]
Don't use VOL internally, because "volatile" works just fine
However, we do preserve it outside PERL_CORE for the use of XS authors.
Aaron Crane [Thu, 12 Oct 2017 13:46:20 +0000 (15:46 +0200)]
Assume C89 "volatile" keyword
The Configure changes here were generated using a version of metaconfig
that makes U/perl/perlxv.U assume that the keyword exists, and prevents
U/modified/d_volatile.U from promising to define a "volatile" keyword;
otherwise, those units would bring in the relevant Configure probe anyway.
Aaron Crane [Thu, 12 Oct 2017 13:18:42 +0000 (15:18 +0200)]
Assume we have C89 memchr()
Aaron Crane [Thu, 12 Oct 2017 12:31:56 +0000 (14:31 +0200)]
Assume we have sane C89 memcmp()
"Sane" means that it works correctly on bytes with their high bit set, as
C89 also requires.
We therefore no longer need to probe for and/or use BSD bcmp().
Aaron Crane [Thu, 12 Oct 2017 13:04:00 +0000 (15:04 +0200)]
Drop support for PowerUX / Power MAX OS
It is almost impossible to find any information about this platform on the
internet, which strongly suggests that it's as dead as dead can be.
Aaron Crane [Thu, 12 Oct 2017 12:00:03 +0000 (14:00 +0200)]
Assume we have C89 memcpy() and memmove()
We can therefore also avoid probing for and/or using BSD bcopy().
Aaron Crane [Thu, 12 Oct 2017 11:47:22 +0000 (13:47 +0200)]
Don't look for a "safe" memcpy()
C89 says that, if you want to copy overlapping memory blocks, you must use
memmove(), and that attempt to copy overlapping memory blocks using memcpy()
yields undefined behaviour. So we should never even attempt to probe for a
system memcpy() implementation that just happens to handle overlapping
memory blocks. In particular, the compiler might compile the probe program
in such a way that Configure thinks overlapping memcpy() works even when it
doesn't.
This has the additional advantage of removing a Configure probe that needs
to execute a target-platform program on the build host.
Aaron Crane [Thu, 12 Oct 2017 09:02:27 +0000 (11:02 +0200)]
Assume we have C89 memset()
This means we also never need to consider using BSD bzero().
Aaron Crane [Thu, 12 Oct 2017 08:33:33 +0000 (10:33 +0200)]
Remove USE_STRUCT_COPY in favour of C89 struct assignment
At least for now, we retain the StructCopy() macro, but its definition
always just uses struct assignment.
Aaron Crane [Sat, 21 Oct 2017 15:42:51 +0000 (16:42 +0100)]
Configure: fix nl_langinfo_l() probe
This corresponds to metaconfig
ad82f5bfbeafc125c0aed2b83391ed8d43bf31b2.
H.Merijn Brand [Sat, 21 Oct 2017 15:41:04 +0000 (17:41 +0200)]
Add Configure changes to perldelta
H.Merijn Brand [Sat, 21 Oct 2017 15:29:47 +0000 (17:29 +0200)]
Add new Configure probes
This is a merge off several new probes in metaconfig done in the new
shared developing environment by several authors
Thanks to all that contributed!
Steve Hay [Fri, 20 Oct 2017 23:17:00 +0000 (00:17 +0100)]
Today's M::CL is up on CPAN already
Steve Hay [Fri, 20 Oct 2017 23:11:33 +0000 (00:11 +0100)]
Prepare Module::CoreList for 5.27.6
Steve Hay [Fri, 20 Oct 2017 22:54:15 +0000 (23:54 +0100)]
Bump version to 5.27.6
Steve Hay [Fri, 20 Oct 2017 22:45:38 +0000 (23:45 +0100)]
perldelta - Fix version for the next run of Porting/acknowledgements.pl
And fix the template file so that the impending version bump will leave it
correct for next time too.
Steve Hay [Fri, 20 Oct 2017 22:41:00 +0000 (23:41 +0100)]
New perldelta for 5.27.6
Steve Hay [Fri, 20 Oct 2017 22:27:06 +0000 (23:27 +0100)]
Tick off 5.27.5
Steve Hay [Fri, 20 Oct 2017 22:26:13 +0000 (23:26 +0100)]
Add epigraph for 5.27.5
Steve Hay [Fri, 20 Oct 2017 20:20:22 +0000 (21:20 +0100)]
Perl 5.27.5 today
Steve Hay [Fri, 20 Oct 2017 20:16:59 +0000 (21:16 +0100)]
Finalize perldelta
Steve Hay [Fri, 20 Oct 2017 20:09:37 +0000 (21:09 +0100)]
Update Module::CoreList for 5.27.5
Steve Hay [Fri, 20 Oct 2017 20:06:10 +0000 (21:06 +0100)]
perldelta - Fix broken links
Steve Hay [Fri, 20 Oct 2017 19:52:32 +0000 (20:52 +0100)]
perldelta - Remove boilerplate
Steve Hay [Fri, 20 Oct 2017 19:47:46 +0000 (20:47 +0100)]
perldelta - Update selected bug fixes etc
Steve Hay [Fri, 20 Oct 2017 18:45:46 +0000 (19:45 +0100)]
perldelta - Update modules
Steve Hay [Fri, 20 Oct 2017 18:45:04 +0000 (19:45 +0100)]
Suppress spurious corelist-perldelta.pl warning
Steve Hay [Fri, 20 Oct 2017 18:43:41 +0000 (19:43 +0100)]
Teach corelist-perldelta.pl about libnet, podlators and Sub::Util
Steve Hay [Fri, 20 Oct 2017 07:25:35 +0000 (08:25 +0100)]
Porting/Maintainers.pl - version's vxs.inc is now CUSTOMIZED as well
Steve Hay [Fri, 20 Oct 2017 07:22:33 +0000 (08:22 +0100)]
Porting/Maintainers.pl - NEXT is CUSTOMIZED
Father Chrysostomos [Fri, 20 Oct 2017 04:35:51 +0000 (21:35 -0700)]
Deparse.t tweak
The revert two commits ago causes B::Deparse to go through a different
code path when dumping the constant. Ideally the output should be the
same either way (i.e., consistently with or without a semicolon, not
sometimes one way and sometimes the other). But for now, just make
the test more lenient.
Father Chrysostomos [Fri, 20 Oct 2017 03:14:29 +0000 (20:14 -0700)]
Father Chrysostomos [Fri, 20 Oct 2017 01:18:37 +0000 (18:18 -0700)]
Temporarily revert CV-in-stash optimisation
This reverts two hunks from
6881372e19 to allow CPAN modules some time
to conform to the optimisation.