| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In GH 20435 many typos in our C code were corrected. However, this pull
request was not applied to blead and developed merge conflicts. I
extracted diffs for the individual modified files and applied them with
'git apply', excepting four files where patch conflicts were reported.
Those files were:
handy.h
locale.c
regcomp.c
toke.c
We can handle these in a subsequent commit. Also, had to run these two
programs to keep 'make test_porting' happy:
$ ./perl -Ilib regen/uconfig_h.pl
$ ./perl -Ilib regen/regcomp.pl regnodes.h
|
|
|
|
|
|
|
|
|
| |
Perl_(([cm]|re)alloc|mfree) should not be used by the public; instead
there are macros that these implement.
The *alloc functions weren't documented, because of an erroneous
assumption; erroneous because all require the Perl_ preface to call
them.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the removal of PERL_OBJECT
(acfe0abcedaf592fb4b9cb69ce3468308ae99d91) PERL_IMPLICIT_CONTEXT and
MULTIPLICITY have been synonymous and they're being used interchangeably.
To simplify the code, this commit replaces all instances of
PERL_IMPLICIT_CONTEXT with MULTIPLICITY.
PERL_IMPLICIT_CONTEXT will stay defined for compatibility with XS
modules.
|
|
|
|
|
|
|
|
|
|
|
| |
This just detabifies to get rid of the mixed tab/space indentation.
Applying consistent indentation and dealing with other tabs are another issue.
Done with `expand -i`.
* vutil.* left alone, it's part of version.
* Left regen managed files alone for now.
|
|
|
|
|
|
|
|
| |
Many of the files in perl are for one thing only, and hence their
embedded documentation will be for that one thing. By creating a hash
here of them, those files don't have to worry about what section that
documentation goes under, and so it can be completely changed without
affecting them.
|
|
|
|
|
| |
This uses a new organization of sections that I came up with. I asked
for comments on p5p, but there were none.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This breaks in malloc.c when configured using the Perl malloc implementation i.e. -Dusemymalloc
End result is this when linking:
/usr/bin/ld: malloc.o: in function `Perl_mfree':
malloc.c:(.text+0x98): undefined reference to `nBITMASK'
/usr/bin/ld: malloc.c:(.text+0xb9): undefined reference to `nBITMASK'
/usr/bin/ld: malloc.c:(.text+0xd3): undefined reference to `nBITMASK'
/usr/bin/ld: malloc.c:(.text+0x138): undefined reference to `nBITMASK'
/usr/bin/ld: malloc.o: in function `Perl_malloced_size':
malloc.c:(.text+0x1fc): undefined reference to `nBITMASK'
/usr/bin/ld: malloc.o:malloc.c:(.text+0x328): more undefined references to `nBITMASK' follow
|
|
|
|
|
| |
It only does anything under PERL_GLOBAL_STRUCT, which is gone.
Keep the dNOOP defintion for CPAN back-compat
|
|
|
|
|
| |
This encapsulates a common paradigm, making sure that it is done
correctly for the platform's size.
|
|
|
|
| |
This needed a const to compile, and there were warnings as well.
|
|
|
|
| |
The macro is more efficient
|
|
|
|
| |
As they are really Unix calls
|
|
|
|
|
| |
This was due to a missing declaration for thread context needed to
output a message.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without doing this, it is possible that the behavior is undefined when
subtracting two pointers that point to the same object.
See thread beginning at
http://nntp.perl.org/group/perl.perl5.porters/251541
In particular this from Tomasz Konojacki
C11 says:
> When two pointers are subtracted, both shall point to elements of the
> same array object, or one past the last element of the array object;
> the result is the difference of the subscripts of the two array
> elements. The size of the result is implementation-defined, and its
> type (a signed integer type) is ptrdiff_t defined in the <stddef.h>
> header. If the result is not representable in an object of that type,
> the behavior is undefined.
There are many ways to interpret this passage, but according to (most?)
C compilers developers, it means that no object can be larger than
PTRDIFF_MAX. For example, gcc's optimizer assummes that strlen() will
never return anything larger than PTRDIFF_MAX [1].
There's also a blogpost[2] on this topic, which IMO is a very
interesting read.
If gcc and clang can assume that all objects won't be larger than
PTRDIFF_MAX, so can we. Also, in practice, ssize_t and ptrdiff_t on most
(all?) platforms are defined as exactly the same type.
BTW, the fact that compilers assume that objects can't be larger than
PTRDIFF_MAX has very dangerous implications on 32-bit platforms. Is it
possible to create string longer than PTRDIFF_MAX on 32-bit perls?. It
shouldn't be allowed.
[1] - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78153
[2] - https://trust-in-soft.com/objects-larger-than-ptrdiff_max-bytes/
|
|
|
|
|
|
|
|
| |
Some size computations were using the wrong data type, in particular
getting a signed 32-bit type where unsigned 64-bit is required on
LP64 systems. That resulted in truncation and in sign extension during
later conversion to the correct type, either way producing bogus sizes.
Fix by casting everything to size_t suitably early. Fixes [perl #119829].
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
C++11 requires space between the end of a string literal and a macro, so
that a feature can unambiguously be added to the language. Starting in
g++ 6.2, the compiler emits a warning when there isn't a space
(presumably so that future versions can support C++11). Unfortunately
there are many such instances in the perl core. This commit fixes
those, including those in ext/, but individual commits will be used for
the other modules, those in dist/ and cpan/.
This commit also inserts space at the end of a macro before a string
literal, even though that is not deprecated, and removes useless ""
literals following a macro (instead of inserting a blank). The result
is easier to read, making the macro stand out, and be clearer as to the
intention.
Code and modules included with the Perl core need to be compilable using
C++. This is so that perl can be embedded in C++ programs. (Actually,
only the hdr files need to be so compilable, but it would be hard to
test that just the hdrs are compilable.) So we need to accommodate
changes to the C++ language.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The build will die already on errors because of the missing ASSERT
macros (plus get warnings on the implicit declarations, i.e. missing
prototypes), but better to give a clear error.
FWIW, looking at hints/*, only HP-UX of the even remotely
common/current systems seems to use Perl's malloc anymore,
and then only if perlio is NOT being used.
(Other platforms that seemingly use Perl's malloc include ancient
SysVs like SCO 2.3.4, NCR Tower, Tektronix' UTek V, then Unicos and
Unicos/mk of Cray, and NEC's SUPER-UX.) (OS/2 still probably does
use it, given all the work ilyaz used to pour on it.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An empty cpan/.dir-locals.el stops Emacs using the core defaults for
code imported from CPAN.
Committer's work:
To keep t/porting/cmp_version.t and t/porting/utils.t happy, $VERSION needed
to be incremented in many files, including throughout dist/PathTools.
perldelta entry for module updates.
Add two Emacs control files to MANIFEST; re-sort MANIFEST.
For: RT #124119.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some questions and loose ends:
XXX gv.c:S_gv_magicalize - why are we using SSize_t for paren?
XXX mg.c:Perl_magic_set - need appopriate error handling for $)
XXX regcomp.c:S_reg - need to check if we do the right thing if parno
was not grokked
Perl_get_debug_opts should probably return something unsigned; not sure
if that's something we can change.
|
|
|
|
| |
Extracted from patch submitted by Lajos Veres in RT #123693.
|
|
|
|
| |
In particular, remove all instances of 'assert(0);'.
|
|
|
|
|
| |
Remaining atoi() uses include at least:
ext/DynaLoader/dl_aix.xs, os2/os2.c, vms/vms.c
|
|
|
|
|
|
| |
This reverts commit 148f39b7de6eae9ddd59e0b0aff691d6abea7aca.
(Still needs more work, but wanted to see how well this passed with Jenkins.)
|
|
|
|
|
|
| |
Definitely not *after* it. It marks the start of the unreachable,
not the first unrechable line. And if they are in that order,
it looks better to linebreak after the lint hint.
|
| |
|
|
|
|
| |
This was added in 2003, but never used.
|
| |
|
|
|
|
|
|
| |
This was only defined for MSDOS if not using DJGPP. We've long
since dropped support for that, so this define and related code
can go.
|
| |
|
|
|
|
|
|
| |
Error was also spotted by mauke.
For: RT #119213
|
|
|
|
|
|
|
| |
This finishes the removal of register declarations started by
eb578fdb5569b91c28466a4d1939e381ff6ceaf4. It neglected the ones in
function parameter declarations, and didn't include things in dist, ext,
and lib, which this does include
|
|
|
|
| |
Broken by commit 7cd83f6573.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes [perl #40595]. When Perl_malloc reports an out of
memory error, it should not make calls to PerlIO functions that
may turn around and allocate memory using Perl_malloc. A simple
write() should be ok, though. Inspired by S_write_no_mem() from
util.c. Also replaces the local write2 function, which did the
same thing slightly differently.
Under -DDEBUGGING, there are other calls to PerlIO_printf that are
also likely unsafe, but that problem is not addressed here.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This removes most register declarations in C code (and accompanying
documentation) in the Perl core. Retained are those in the ext
directory, Configure, and those that are associated with assembly
language.
See:
http://stackoverflow.com/questions/314994/whats-a-good-example-of-register-variable-usage-in-c
which says, in part:
There is no good example of register usage when using modern compilers
(read: last 10+ years) because it almost never does any good and can do
some bad. When you use register, you are telling the compiler "I know
how to optimize my code better than you do" which is almost never the
case. One of three things can happen when you use register:
The compiler ignores it, this is most likely. In this case the only
harm is that you cannot take the address of the variable in the
code.
The compiler honors your request and as a result the code runs slower.
The compiler honors your request and the code runs faster, this is the least likely scenario.
Even if one compiler produces better code when you use register, there
is no reason to believe another will do the same. If you have some
critical code that the compiler is not optimizing well enough your best
bet is probably to use assembler for that part anyway but of course do
the appropriate profiling to verify the generated code is really a
problem first.
|
|
|
|
|
|
|
|
| |
The 80286 was released two years before Perl 1, but the support code was
added with Perl 3. The chip hasn't been produced for more than 15 years -
even the 80386 hasn't been manufactured since 2007. Most of the other
memory model code was removed by commit 5869b1f143426909 in Sep 2000, so
support for 16 bit systems is long dead.
|
|
|
|
|
| |
The subdirectory containing the port specific files was purged when 5.000
was released, but changes made to other files were not removed.
|
| |
|
|
|
|
| |
to make sure it really is never reached.
|
|
|
|
|
| |
This updates the editor hints in our files for Emacs and vim to request
that tabs be inserted as spaces.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It only ever worked properly in 5.005.
Commit d720c4410d3a0730 from June 1998 is the first known version of malloc.c
that would compile stand alone, without needing a config.h
Commit 5bbd1ef51ee0ebfa from December 1998 will not compile by default,
but will if one provides suitable definitions of simple macros on the command
line.
Commit 427181846486e3aa from September 1999 will not compile with command
line flags alone.
12 years later, no-one has reported problems, so it's safe to remove this.
|
|
|
|
|
|
|
|
|
|
| |
In 1998 commit 30e2e4257067d5f8 stated
temporarily disable perl malloc for a2p until we clean up
conflicting malloc() declarations everywhere
and nothing has changed since. 13 years later, no-one has reported problems,
so it's safe to remove it.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
grep.cpan.me and Google's codesearch find no use of WITH_THR or WITH_THX.
WITH_THX() was added in June 1999 in cea2e8a9dd23747f, and the last user
eliminated with 0b250b9ef0d5134f in August 1999. WITH_THX() was used again
for DEBUG_CX() in 1c98cc53150c4860, and eliminated in d9f81b50694a810f.
WITH_THR() was added in 1997 in 0f15f207c55ce70f. Use everywhere except
DEBUG_SCOPE() was eliminated in 2006 in 11206fddaf7ef068. WITH_THR() was
removed from DEBUG_SCOPE() in d9f81b50694a810f.
|
|
|
|
|
|
|
|
|
| |
# New Ticket Created by (Peter J. Acklam)
# Please include the string: [perl #81904]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=81904 >
Signed-off-by: Abigail <abigail@abigail.be>
|
|
|
|
|
| |
Replace ckWARN_d{,2,3,4}() && Perl_warner() with it, which trades reduced code
size for 1 more function call if warnings are not enabled.
|