| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
This function only sets *retlen to 0 if the input length is 0. In all
but one case, the function was not called with with that input. In that
one case, I changed to avoid calling the function with that input.
Hence we can remove checking *retlen for 0.
|
|
|
|
|
|
|
|
|
|
| |
This code effectively reduced to
if (foo) 0 else 0
because a #define was changed to 0 some releases ago. Just replace by
0
|
| |
|
|
|
|
|
|
|
| |
The previous commit added this feature; now this commit uses it in core.
toke.c is deferred to the next commit to aid in possible future
bisecting, because some of the changes there seem somewhat more likely
to expose bugs.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
| |
A value may legitimately be marked SvTEMP even when it is not about
to be freed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Mainly to avoid Inf and NaN, which VAX does does not have.
There is something like Inf called "excess" but that is
a deadly exception, seems to manifest itself in vax-netbsd
either as a SIGFPE or SIGSEGV (pretty much untrappable at
least from Perl level).
The range of VAX floats is different from IEEE.
There is positive zero, but no negative zero.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The value of gimme stored in the context stack is U8.
Make all other uses in the main core consistent with this.
My primary motivation on this was that the new function cx_pushblock(),
which I gave a 'U8 gimme' parameter, was generating warnings where callers
were passing I32 gimme vars to it. Rather than play whack-a-mole, it
seemed simpler to just uniformly use U8 everywhere.
Porting/bench.pl shows a consistent reduction of about 2 instructions on
the loop and sub benchmarks, so this change isn't harming performance.
|
|
|
|
|
| |
With a utf8 target but a non-utf8 source, pack Hh would read past the
end of the source when given a length, due to an incorrect condition.
|
|
|
|
| |
Removes 'the' in front of parameter names in some instances.
|
|
|
|
| |
unpack '%65...' failures, to be more exact.
|
| |
|
| |
|
|
|
|
|
|
|
| |
VC6 was returning either packed float +inf or packed float -inf
(I dont remember) instead of packed float NAN in t/op/infnan.t .
This fixes #125203
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
This was introduced by 9df874cdaa2f196cc11fbd7b82a85690c243eb9f
in changing the name of some static functions. I didn't realize at the
time that the function was defined in embed.fnc, as none of the others
are, and it was always called with the S_ prefix form. Nor did I notice
the compiler warnings.
It turns out that the base name of this function is the same as a public
function, so I've renamed it to have prefix 'S_my_'.
|
|
|
|
|
| |
NEXTFROM() modified the item count while testing it, so the next use
saw the count (of -1) as non-zero and ended up trying to write ~1 bytes.
|
|
|
|
|
| |
This outdents some code whose enclosing block was removed in the
previous commit
|
|
|
|
|
|
|
|
| |
As noted in the thread starting at
http://nntp.perl.org/group/perl.perl5.porters/223366
and in the comments added in this commit, strings packed in 'u' format
don't need any UTF-8ness special handling, so the code that did that can
be removed.
|
|
|
|
|
| |
This commit causes the same code to be executed whether on an ASCII or
EBCDIC platform.
|
|
|
|
|
| |
Early code tends to conflate the terms Unicode and UTF-8. I find that
confusing.
|
|
|
|
|
|
|
|
|
|
| |
Treat the string as U8* rather than char* when doing all the
bit shifts for uuencode. That stops these warnings under ASan:
pp_pack.c:1890:34: runtime error: left shift of negative value -127
pp_pack.c:1891:34: runtime error: left shift of negative value -126
pp_pack.c:1899:34: runtime error: left shift of negative value -1
pp_pack.c:1900:30: runtime error: left shift of negative value -31
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The C standard says that the value of the expression (float)double_var is
undefined if 'the value being converted is outside the range of values
that can be represented'.
So to shut up -fsanitize=undefined:
my $p = pack 'f', 1.36514538e67;
giving
runtime error: value 1.36515e+67 is outside the range of representable values of type 'float'
explicitly handle the out of range values.
Something similar is already done under defined(VMS) && !defined(_IEEE_FP),
except that there it floors to +/- FLT_MAX rather than +/- (float)NV_INF.
I don't know which branch is best, and whether they should be merged.
This fix was suggested by Aaron Crane.
|
|
|
|
| |
See <20141130160250.GC31019@pjcj.net>. Commit 354b74ae6f broke this.
|
|
|
|
| |
The 'U' pack/unpack format must be in terms of Unicode code points.
|
| |
|
| |
|
| |
|
|
|
|
| |
At Jarkko Hietaniemi’s suggestion.
|
| |
|
|
|
|
|
|
|
| |
sprintf, pack and chr were treating 0+"Inf" and "Inf" differently,
even though they have the same string and numeric values.
pack was also croaking for 0+"Inf" passed to a string format.
|
|
|
|
| |
Also make the type I32, not char.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
In pack: No point in trying to return all-bit-off/all-bits-one
because inf/-inf/nan really don't map sensibly into integers.
In printf-%c/chr: while U+FFFD would be an option, better to die
on such weird input.
pack-as-fp still works, sprintf-numeric still works.
Make t/op/infnan.t to be less fragile about the number of expected tests.
|
|
|
|
| |
(For inf, the existing code already did this, slowly.)
|
| |
|
| |
|
|
|
|
|
|
|
| |
Made them return the 0xFF byte (and warn). Not necessarily the best
choice, but there's not that much room in just 256 bytes for all of
the inf/-inf/nan. This same choice will need to be made with wider
integer packs.
|
|
|
|
|
|
|
|
| |
You need to configure with g++ *and* -Accflags=-DPERL_GLOBAL_STRUCT
or -Accflags=-DPERL_GLOBAL_STRUCT_PRIVATE to see any difference.
(g++ does not do the "post-annotation" form of "unused".)
The version code has some of these issues, reported upstream.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- after return/croak/die/exit, return/break are pointless
(break is not a terminator/separator, it's a goto)
- after goto, another goto (!) is pointless
- in some cases (usually function ends) introduce explicit NOT_REACHED
to make the noreturn nature clearer (do not do this everywhere, though,
since that would mean adding NOT_REACHED after every croak)
- for the added NOT_REACHED also add /* NOTREACHED */ since
NOT_REACHED is for gcc (and VC), while the comment is for linters
- declaring variables in switch blocks is just too fragile:
it kind of works for narrowing the scope (which is nice),
but breaks the moment there are initializations for the variables
(the initializations will be skipped since the flow will bypass
the start of the block); in some easy cases simply hoist the declarations
out of the block and move them earlier
Note 1: Since after this patch the core is not yet -Wunreachable-code
clean, not enabling that via cflags.SH, one needs to -Accflags=... it.
Note 2: At least with the older gcc 4.4.7 there are far too many
"unreachable code" warnings, which seem to go away with gcc 4.8,
maybe better flow control analysis. Therefore, the warning should
eventually be enabled only for modernish gccs (what about clang and
Intel cc?)
|
|
|
|
|
|
|
| |
This reverts commit 8c2b19724d117cecfa186d044abdbf766372c679.
I don't understand - smoke-me came back happy with three
separate reports... oh well, some other time.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- after croak/die/exit (or return), break (or return!) are pointless
(break is not a terminator/separator, it's a promise of a jump)
- after goto, another goto (!) is pointless
- in some cases (usually function ends) introduce explicit NOT_REACHED
to make the noreturn nature clearer (do not do this everywhere, though,
since that would mean adding NOT_REACHED after every croak)
- for the added NOT_REACHED also add /* NOTREACHED */ since
NOT_REACHED is for gcc (and VC), while the comment is for linters
- declaring variables in switch blocks is just too fragile:
it kind of works for narrowing the scope (which is nice),
but breaks the moment there are initializations for the variables
(they will be skipped!); in some easy cases simply hoist the declarations
out of the block and move them earlier
There are still a few places left.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It is not very user friendly to list functions as
"Functions found in file FOO". Better is to group them by purpose, as
many were already. I went through and placed the ones that weren't
already so grouped into groups. Patches welcome if you have a better
classification.
I changed the headings of some so that the important disctinction was
the first word so that they are placed in the file more appropriately.
And a couple of ones that I had created myself, I came up with a name
that I think is better than the original
|
|
|
|
|
|
|
| |
Used by linters (static checkers), and also good for human readers.
Even though "FALL THROUGH" seems to be the most common, e.g BSD lint
manual only knows "FALLTHROUGH" (or "FALLTHRU").
|
|
|
|
|
|
|
|
|
|
|
| |
If IVSIZE >= 8, a Quad_t is always >= IV_MIN, and <= IV_MAX, and an
Uquad_t is always (>= 0 aka UV_MIN and) <= UV_MAX; they cannot escape
their quadness and be NVs. (This logic may fail if Quad_t is not 8
bytes, but then other things would no doubt fail.)
Also tighten the logic by adding HAS_QUAD, also for the pack case.
Fix for Coverity perl5 CID 28942.
|