| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
"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().
|
|
|
|
| |
This means we also never need to consider using BSD bzero().
|
|
|
|
|
| |
At least for now, we retain the StructCopy() macro, but its definition
always just uses struct assignment.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In f14cf363205 we added asserts to our memory macros (Copy(), Zero() etc)
to ensure that the target is non-null. These asserts throw warnings like
perl.c: In function ‘Perl_eval_sv’:
perl.c:2976:264: warning: the address of ‘myop’ will always evaluate
as ‘true’ [-Waddress]
Zero(&myop, 1, UNOP);
which is annoying. This patch changes how these asserts are coded so
we avoid the warning. Thanks to Zefram for the fix.
|
|
|
|
| |
ALign some things vertically for easier reading
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These functions depend on C library functions which have undefined
behaviour when passed NULL pointers, even when passed a zero 'n' value.
Some compilers use this information, ie. assume the pointers are
non-NULL when optimizing any following code, so we do need to
prevent such unguarded calls.
My initial thought was to add conditionals to each macro to skip the
call to the library function when n is zero, but this adds a cost to
every use of these macros, even when the n value is always true.
So instead I added asserts() which will give us a much more visible
indicator of such broken code and revealed the pp_caller and Glob.xs
issues also patched here.
|
|
|
|
|
|
|
|
|
|
| |
We changed to use symbols not likely to be used by non-Perl code that
could conflict, and which have trailing underbars, so they don't look
like a regular Perl #define.
See https://rt.perl.org/Ticket/Display.html?id=131110
There are many more header files which are not guarded.
|
|
|
|
|
| |
This is so their use cannot spread easily until we have sorted things
out in 5.27
|
|
|
|
|
|
|
|
| |
This reverts commit 84b32f52b10f9912b40ef378cd0b01f4aff80630.
This reverts commit d30393aaade31b605724846a30a10dd1e96cd181.
We need more debate on this one; either we should undeprecate it,
or settle on an end-of-life version.
|
|
|
|
|
|
|
| |
Since we now require each deprecation message to come with a
version in which the feature will disappear, and we have reworked
the existing uses of this macro, there doesn't seem to be a need
for this one anymore.
|
|
|
|
|
| |
Hence, we adapted the warning, to mention the version in which it
will become a fatal error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The :unique and :locked attributes have had no effect since 5.8.8
and 5.005 respectively. They were deprecated in 5.12. They are now
scheduled to be deleted in 5.28.
There are two places the deprecation warning can be issued:
in lib/attributes.pm, and in toke.c. The warnings were phrased
differently, but since we're changing the warning anyway (as we
added the version of Perl in which the attributes will disappear),
we've used the same phrasing for this warning, regardless of where
it is generated:
Attribute "locked" is deprecated, and will disappear in Perl 5.28
Attribute "unique" is deprecated, and will disappear in Perl 5.28
|
|
|
|
| |
This only affected EBCDIC builds, causing syntax errors.
|
| |
|
|
|
|
| |
Now that there are _safe versions, deprecate the unsafe ones.
|
| |
|
| |
|
|
|
|
|
| |
This creates several macros that future commits will use to provide a
layer between the caller and the function.
|
|
|
|
|
| |
This text appears in the middle of C<>, but is meant to be substituted
for, instead of being typed in as-is.
|
| |
|
|
|
|
|
|
| |
These macros are being replaced by a safe version; they now generate a
deprecation message at each call site upon the first use there in each
program run.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original API does not check that we aren't reading beyond the end of
a buffer, apparently assuming that we could keep malformed UTF-8 out by
use of gatekeepers, but that is currently impossible. This commit adds
"safe" macros for determining if a UTF-8 sequence represents
an alphabetic, a digit, etc. Each new macro has an extra parameter
pointing to the end of the sequence, so that looking beyond the input
string can be avoided.
The macros aren't currently completely safe, as they don't test that
there is at least a single valid byte in the input, except by an
assertion in DEBUGGING builds. This is because typically they are
called in code that makes that assumption, and frequently tests the
current byte for one thing or another.
|
|
|
|
| |
This also fixes some orphaned references.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason s suffix macro definitions intended for handling
constant string arguments were put into handy.h and not into hv.h.
I think this is wrong, especially as the macro defintions have
"drifted" and are not properly defined in terms the right base
macros.
Also we want to have such wrappers for the main hash functions,
so move them all to hv.h, recode them properly in terms of the
right base macros, and add support for the missing functions.
|
|
|
|
|
|
|
|
|
|
|
|
| |
memEQs() is already defined, and requires a length parameter for
the first pointer argument. However some times we do not have
this length handy and simply want to use the length of the constant
string instead.
In an ideal world, to be compatible with more s suffix macros,
IMO the existing memEQs() should have been called something like
memEQsl() maybe, and the ones I am adding would get the memEQs(
name, but it didnt work out like that.
|
|
|
|
|
| |
They use strncmp() and derive the length using STR_WITH_LEN style
tricks in the wrapper call.
|
|
|
|
|
| |
Instead of having each file have them, keep them in handy.h, but only
for core compilations.
|
| |
|
|
|
|
|
| |
These correspond to strLT, etc. I am deferring documenting them in case
this turns out to be a bad idea for some reason.
|
| |
|
|
|
|
| |
This potentially saves a branch
|
|
|
|
|
| |
The ones in cpan/File-Temp/ have been submitted upstream as
https://github.com/Perl-Toolchain-Gang/File-Temp/pull/20
|
|
|
|
|
| |
These should have been in the recent commit
6c5b02ac7a9ff1c91f2ca46bedd89ba9012bb34f
|
|
|
|
|
|
|
| |
This removes some '#ifdef EBCDIC' so as to make more code common between
the platforms. This is at the expense of some efficiency, but the
affected code only runs when compiling utilities, so ease of maintenance
wins out.
|
| |
|
|
|
|
|
|
|
|
|
| |
This extends the mechanism we added in 5.24 to more macros to make sure
that a macro is called with an integer and not a pointer. It adds a
"| 0"
to the macro parameter, which is illegal if the parameter is a pointer.
|
| |
|
|
|
|
|
|
|
|
| |
It had rotted a bit Well, more than one probably.
Move the declarations of the functions Perl_mem_log_alloc etc from handy.h
into embed.fnc where whey belong, and where Malloc_t will have already
been defined.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I realized that we have inconsistent naming conventions for the
isFOO_uni() macros, like isALPHA_uni(). The "_uni" suffix elsewhere
refers to official Unicode code point numbers; whereas, for these macros
it refers to the native code point numbers for code points below 256.
And elsewhere, there are in some cases a _uni() and a uvchr() which mean
different things.
This commit adds '_uvchr' suffix equivalents for these macros, while
dropping mention in the documentation of the '_uni' forms. Thus code
following the new paradigm will not be confusing, while existing code
will function unchanged.
|
|
|
|
|
| |
And at the same time hopefully avoid some false-positive compiler warnings
on HP-UX
|
|
|
|
| |
Some entries already had this. For those, it standardizes the text.
|
|
|
|
| |
This catches bugs such as the one fixed in commit dcf88e34.
|
|
|
|
| |
A string strictly is NUL terminated, but our terminology is lax
|
|
|
|
|
|
|
|
| |
Similar in spirit to 3e94db23
Coverity id #28938
Coverity id #104778
Coverity id #131329
|
|
|
|
| |
(As suggested by khw.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some bits of code don't do well on a 32-bit system with 64-bit ints
(-Duse64bitint)
In particular:
_MEM_WRAP_NEEDS_RUNTIME_CHECK:
if sizeof(MEM_SIZE) > sizeof(n), then the shift count could be
negative
S_regmatch:
ln and n were two different sizes and signesses, so comparing them
warned. Since they were being mis-used as two convenient temporary
booleans anyway, just use temporary booleans instead.
Perl_sv_vcatpvfn_flags:
the test/assertion (IV)elen < 0 was (I think) being used to test for
signed/unsigned conversion wrap-around. elen is of type STRLEN which
is a pointer-based type, so can be 32-bit while IV is 64-bit. Instead
compare it to half the maximum value of a STRLEN var to see if it may
have wrapped.
|
|
|
|
|
|
| |
This changes the definition of isUTF8_POSSIBLY_PROBLEMATIC() on EBCDIC
platforms to use PL_charclass[] instead of PL_e2a[]. The new array is
more likely to be in the memory cache.
|
|
|
|
| |
This is for the next commit.
|
|
|
|
|
|
|
|
|
| |
This adds a macro that converts a code point in the ASCII 128-255 range
to UTF-8, and changes existing code to use it when the range is known to
be restricted to this one, rather than the previous macro which accepted
a wider range (any code point representable by 2 bytes), but had an
extra test on EBCDIC platforms, hence was larger than necessary and
slightly slower.
|