summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* ext/B/t/OptreeCheck.pm: Escape literal pattern '{'Karl Williamson2016-05-091-3/+3
| | | | | The deprecated warnings were getting suppressed, but literal '{' in patterns needs to be escaped.
* Make deprecated qr//xx fatalKarl Williamson2016-05-092-14/+6
| | | | This has been deprecated since v5.22
* Document exports policy within POSIXAristotle Pagaltzis2016-04-261-2/+7
|
* Correct lround situation comment in POSIXAristotle Pagaltzis2016-04-261-4/+3
|
* Strengthen cautions about locale use with threadsKarl Williamson2016-04-081-0/+7
| | | | | This comes from our increased understanding of their perils, given ticket #127708
* Export lround() from POSIXAaron Crane2016-04-024-2/+17
| | | | | | | This function was implemented as of 5.21.4, but not exported (even by request). It's too late in the 5.24 freeze for it to be exported by default, or as part of a tag, but we can at least make it available to those who want to import it by name.
* ODBM_File version bumpJarkko Hietaniemi2016-03-271-1/+1
|
* [perl #127751] error building ODBM_File on Windows, perl 5.23.9Jarkko Hietaniemi2016-03-271-0/+4
| | | | | | No POSIX open in Win32, broken by ed6087adbd9c90b59cf3f08af7c23a947c00bf69 Use the PerlLIO_open3 as suggested by Tony Cook, use the same trick as POSIX.xs
* fix up dtrace compile/link for SolarisDavid Mitchell2016-03-181-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [perl #127543] On some platforms, the use of dtrace / SystemTap requires generating an extra .o file from a list of .o files before linking. For example, cc -o foo a.o b.o c.o has to be replaced with dtrace -G -s dtrace.d -o dtrace.o a.o b.o c.o # creates dtrace.o cc -o foo dtrace.o a.o b.o c.o On Solaris in particular, "dtrace -G" modifies the *.o files that it's passed as well as creating dtrace.o, and all the new/updated .o files need to be linked together at the same time from the same single use of "dtrace -G". This complicates matters when building all of miniperl, libperl and perl, and the reason for this commit is that once a dtrace probe made its way into an inline static function via the recent context work, Solaris stopped building under -Dusedtrace -Duseshrplib. The fix that seems to work under both Solaris and Linux, for all 4 permutations of -Dusedtrace +/- -Duseshrplib, is (approx): # compile all the *.o's, then: # build miniperl: $ dtrace ... -o dtrace_mini.o a.o b.o c.o perlminimain.o $ cc -o miniperl dtrace_mini.o a.o b.o c.o perlminimain.o # build libperl.a or .so: $ dtrace ... -o dtrace_perllib.o a.o b.o c.o $ ar rcu libperl.a dtrace_perllib.o a.o b.o c.o # build perl: $ dtrace ... -o dtrace_main.o perlmain.o $ cc -o perl dtrace_main.o -lperl This is has only recently arisen because we switched from PUSHSUB() etc macros to S_cx_pushsub() etc inline functions, which contain probes. Since the inline static functions, and hence the probes, are now included in every source file, and since Solaris isn't smart enough to remove inline static fns that aren't used in a particular compilation unit, the probes end up getting used in every source file (at least where PERL_CORE is true). It also required fixing up XS-APItest's Makefile.PL, since one object file is compiled using PERL_CORE.
* APItest.xs silence compiler warningDavid Mitchell2016-03-122-2/+2
| | | | | On Solaris: "APItest.xs", line 1519: warning: integer overflow detected: op "<<"
* Fix various pod errors.Karl Williamson2016-03-114-47/+60
| | | | Mostly these are too long verbatim lines.
* Export Winsock error constants from POSIX.pmSteve Hay2016-03-114-0/+67
|
* Export Winsock error constants from Errno.pmSteve Hay2016-03-111-4/+24
|
* POSIX.xs: Avoid a leak in setlocale()Karl Williamson2016-03-042-3/+2
| | | | Tony Cook suggested this fix.
* perlfunc overhaulLukas Mai2016-02-272-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - remove trailing whitespace - consistently refer to builtins as C<foo>, not foo() or C<foo()> - hyperlink each C<foo> builtin to its section in perlfunc - replace some occurrences of -w with a reference to the warnings pragma - refer to listy comma as "list concatenation" because that's what it does - consistently hyperlink references to external programs (L<touch(1)>), system calls (L<fork(2)>), and library functions (L<fdopen(3)>) - hyperlink variables to their section in perlvar - hyperlink the names of modules/pragmas - hyperlink names of functions provided by modules (where possible) - consistently use "pragmas", not "pragmata" (there were only two of those) - use the same wording for all conditional builtins / features - -T and -B are file tests, not switches - remove "see L</open>" (regarding the ':encoding' layer) from description of binmode because I don't see why it was there - refer to variables as C<$foo>, not $foo - hyperlink some error messages to perldiag - remove & from subroutine calls - grammar: write "if X, Y" with a comma and "Y if X" without - use 'my' in examples when introducing new variables - 'while (', not 'while(' - don't capitalize the next word after a semicolon - consistently start error messages (die/warn) with "Can't" (not "can't", "Cannot", or "cannot") - replace bareword filehandles by normal variables in examples - add missing ')' - fix module names: IPC::SysV::Msg -> IPC::Msg, IPC::SysV::Semaphore -> IPC::Semaphore - 'open': replace note about binmode with equivalent paragraph from 'binmode' (the one in 'open' claimed unix systems don't need binmode, which is not true with encodings) - 'open': delete overly clever example of generating filehandle names in a recursive function (this is a non-issue with lexical filehandles) - 'open': instead of running 'perl -V' and looking for the useperlio line, you can just run 'perl -V:useperlio' - 'open': mention shell feature of 'yourscript.pl <( other command )', which makes the only remaining use of 2-arg open redundant - 'open': sysopen uses different modes than open; they're not "subtly different" and there's no "may" about it - 'open': use $fh->autoflush(1) instead of select/$| dance (especially since the example already loads IO::Handle for no reason) - 'printf': remove garbled text ("Look for this throught pod") - change "use locale 'not_characters'" to the correct "use locale ':not_characters'" - (hopefully) fix inconsistent use of "real filehandle"; use "bareword filehandle" instead to distinguish from scalar variables / globrefs - ":encoding" is a layer, not a pragma - 'readline': actually use readline in examples - ?...? is no longer valid; use m?...? instead - 'sort': whether the algorithm is stable has no effect on runtime complexity, so "That algorithm was not stable, so I<could> go quadratic" is nonsense - 'sort': declaring $a/$b as lexicals is an error regardless of strict - 'sysopen': as far as I can tell the note about depending on fdopen() is only true for non-PerlIO builds - 'use': add an example of what 'use Module VERSION' expands to - add 'select FILEHANDLE' to filehandle related functions Also touch ext/Pod-Functions/Functions_pm.PL to make it parse L<C<foo>|...> in the overview paragraphs. And teach t/porting/podcheck.t about a ton of man pages and some external modules.
* silence warning in Win32COREDaniel Dragan2016-02-241-0/+1
| | | | | Win32CORE.c: In function ‘boot_Win32CORE’: ../../XSUB.h:127:43: warning: unused parameter ‘cv’ [-Wunused-parameter]
* DynaLoader shouldn't use mod2fname when finding .bs files.Craig A. Berry2016-02-131-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | Some platforms (probably only VMS and Android at the moment) take special steps via the function DynaLoader::mod2fname to construct a dynamic library name that will be unique and (if too long) truncated. Then DynaLoader looks for a bootstrap file with the exact same name as the dynamic library except with a .bs file extension. However, ExtUtils::MakeMaker has never produced bootstrap files that have been run through mod2fname, so while a Foo:Bar extension would produce a loadable library named PL__Foo_Bar.exe, the bootstrap would be called Bar.bs. That shouldn't be a problem since the bootstrap file is just Perl code read by Perl, but DynaLoader has (apparently forever) been looking for PL__Foo_Bar.bs and not finding it. So let's look for it by the name under which it actually exists. There are no core extensions that produce non-empty bootstrap files and no existing test coverage, but as-yet-unintegrated versions of MakeMaker do have such tests. See, for example, https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/7f5e9a35addeea7ebfcded28277c85f723e1a5de
* Remove POSIX isfoo() as scheduledKarl Williamson2016-02-115-428/+35
| | | | | The functions like isalnum() have been scheduled for removal in 5.24. This does that.
* [perl #126410] keep the DESTROY cache in mro_metaTony Cook2016-02-081-1/+0
| | | | | | | | | | | | | We're already keeping destroy_gen there, so keep the CV there too. The previous implementation, introduced in 8c34e50d, kept the destroy method cache in the stash's stash, which broke B's SvSTASH method. Before that, the DESTROY method was cached in overload magic. A previous version of this patch didn't clear the destructor cache on a clone, which caused ext/XS-APItest/t/clone_with_stack.t to fail.
* Document broken SvSTASH for %version:: in B's test suiteTodd Rinaldo2016-02-081-0/+22
| | | | | | | RT 126410: This may not be a B bug but we have no test coverage for SvSTASH at the moment. TODO the test until it is working correctly. TonyC: fix syntax error and update MANIFEST
* POSIX version bump.Jarkko Hietaniemi2016-02-071-1/+1
|
* POSIX: strcmp NE strEQ().Jarkko Hietaniemi2016-02-071-3/+3
| | | | | | | | CID 135006: Constant expression result (CONSTANT_EXPRESSION_RESULT) The Coverity 'detail' is priceless: always_true_or: The "or" condition strcmp(strings->name, "decimal_point") || strcmp(strings->name, "thousands_sep") || strcmp(strings->name, "grouping") will always be true because strings->name cannot be equal to two different values at the same time, so it must be not equal to at least one of them.
* POSIX: Check fds against negatives.Jarkko Hietaniemi2016-02-072-33/+33
| | | | | Not directly an open Coverity issue (though previously we have had similar ones) but inspired by the similar change for signal numbers.
* POSIX: Check signal numbers against negatives.Jarkko Hietaniemi2016-02-072-2/+11
| | | | | | | | | | | CID 135020: Argument cannot be negative (NEGATIVE_RETURNS) CID 135021: Argument cannot be negative (NEGATIVE_RETURNS) sigismember() sigaddset() sigdelset() Note that sigaction() already has its own handling for the signal number.
* XS-APItest: Length cannot be negative.Jarkko Hietaniemi2016-02-071-0/+1
| | | | Coverity CID 135019: Argument cannot be negative (NEGATIVE_RETURNS)
* ODBM_File: Avoid TOCTOU and using negative returns.Jarkko Hietaniemi2016-02-071-11/+31
| | | | | | | | | | | | | | | Coverity CID 135022: Argument cannot be negative (NEGATIVE_RETURNS) Coverity CID 135027: Time of check time of use (TOCTOU) Replace use of stat()-guarded use of creat() (wow) with open(...O_EXCL...) (when O_CREAT) so that there is no race condition (TOCTOU) window between the stat() check for non-existence (which can fail also for other reasons) and the two (sic) creat() calls. Similarly, without O_CREAT, use open(...O_RDONLY...) instead of the stat(). Possible problem: arguably, systems old enough to be still using ODBM_File (or requiring creat()) might not have the O_EXCL.
* OpenBSD does not do si_uid with sigaction().Jarkko Hietaniemi2016-02-041-1/+3
| | | | Seen in OpenBSD 4.8, but found no mention of this working in 5.x.
* POSIX version bump.Jarkko Hietaniemi2016-02-031-1/+1
|
* We're against contractions.Jarkko Hietaniemi2016-02-031-1/+1
| | | | More importantly: that apostrophe messed up my Emacs' syntax highlighting.
* Oddly placed unused decls for fma() and the gamma funcs.Jarkko Hietaniemi2016-02-031-3/+7
| | | | The fma() also missing not_here().
* MULTICALL *shouldn't* clear savestackDavid Mitchell2016-02-031-9/+4
| | | | | | | | | | | | | | | | | | | About 25 commits ago in this branch I added a commit: MULTICALL should clear scope after each call To fix RT #116577, which reported that lexicals were only being freed at the end of the MULTICALL, not after each individual call to the sub. In that commit, I added a LEAVE_SCOPE() to the end of the MULTICALL() definition. However, after further thought I realise that's wrong. If a multicall sub does something like { my $x = $_*2; $x }, then the returned value would be freed before the XS code which calls MULTICALL() has a chance to do anything with it (e.g. test for truth, or add it to the return args or whatever). So I think popping the save stack should be the responsibility of the caller of MULTICALL(), rather than of MULTICALL() itself.
* dMULTICALL: remove unused varsDavid Mitchell2016-02-031-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | dMULTICALL declares several vars that are used either to maintain state across multiple calls, or to pass values to PUSHSUB etc, where those macros expected to obtain some of their args by values being implicitly passed via local vars. Since PUSHSUB has been replaced by cx_pushsub() which now has all parameters explicitly passed, there is no longer any need for those vars. So this commit eliminates them: newsp hasargs There are also a couple vars which are no longer used due to changes to the implementation over time; these can also be eliminated: cx multicall_cv Finally, this branch introduced a new var, saveix_floor; rename it to multicall_saveix_floor for consistency with other dMULTICALL vars. Although none of these vars are listed in the documentation, its possible that some code out there may rely on them in some way, and will need to be fixed up.
* convert CX_PUSH/POP/TOPBLOCK to inline fnsDavid Mitchell2016-02-031-1/+1
| | | | | | Replace CX_PUSHBLOCK() with cx_pushblock() etc. No functional changes.
* MULTICALL should clear scope after each callDavid Mitchell2016-02-031-1/+12
| | | | | | | RT #116577 Lexicals etc were only being freed at the end of the MULTICALL, not after each individual call to the sub.
* rename POPFOO() to CX_POPFOO()David Mitchell2016-02-031-1/+1
| | | | | | | | | | | | | | | | Rename all the context-popping macros such as POPBLOCK and POPSUB, by giving them a CX_ prefix. (Do TOPBLOCK too). This is principally to deliberately break any existing non-core use of these non-API macros, as their behaviour has changed in this branch. In particular, POPBLOCK(cx) no longer decrements the cxt stack pointer nor sets cx; instead, cx is now expected to already point to the stack frame which POPBLOCK should process. At the same time, giving them a CX_ prefix makes it clearer that these are all part of a family of macros that manipulate the context stack. The PUSHFOO() macros will be renamed in a later commit.
* APItest.xs: fixup clone_with_stack()David Mitchell2016-02-031-3/+5
| | | | | Make the unwinding and freeing of the old interpreter up to date with the latest handling of PL_scopestack.
* pp_leavesub: reset SP in void contextDavid Mitchell2016-02-031-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In void context, pp_leavesub() doesn't bother resetting SP to the base; either as an efficiency measure, or as an oversight (the other pp_leavefoo functions do reset). This is mostly harmless, as being void context, it's likely to immediately execute pp_nextstate or similar, which will reset the stack anyway. However with attributes, something like my @foo :attr = () causes attributes::import() to be called in void context, and whatever dross it leaves on the stack becomes part of the assign, i.e. that assign becomes the equivalent of: my (@foo, dross) = () which again is fairly harmless, if slightly inefficient. However, the next commit should make pp_leavesub() call FRETMPS, which means that 'dross' may now include freed SVs, which will make pp_aassign choke. This commit also requires ext/XS-APItest/t/call.t to be fixed. Some tests in there (added years ago by myself) test the statu quo; that is, it expects that calling call_sv(G_VOID) will leave return args on the stack. Now it doesn't.
* restore PL_tmps_floor on exitDavid Mitchell2016-02-031-3/+2
| | | | | | | | | | A couple of places were expecting dounwind(-1); LEAVE_SCOPE(0); to restore PL_tmps_floor, since its old value was saved on the savestack. Since that's now stored in the context struct instead, do a POPBLOCK(&cxstack[0]). This problem only showed up on 'make test' rather than 'make test_harness', since only the former sets PERL_DESTRUCT_LEVEL.
* pp_leaveeval: reset stack in VOID contextDavid Mitchell2016-02-031-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | $ perl -Dst -e'eval"1"' Gives: .... ((eval 1):1) leaveeval => (FREED) Change it so that like all the other pp_leavefoo() functions, it does if (gimme == G_VOID) PL_stack_sp = newsp; I can't think of any (non-debugging) perl-level badness the old behaviour can be shown to demonstrate, but best not to have freed values left dangling. This also allows pp_leaveeval() to (like the other pp_leavefoo functions) avoid doing a dSP with the associated unnecessary PUTBACKs and SPAGAINs. Finally, the code to detect a false require is moved to earlier in the function where it's in the same place as the rest of the stack arg processing code.
* make "for my $lex {}" faster under ITHREADSDavid Mitchell2016-02-031-1/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally at the start of a 'for' iteration (pp_enteriter), we store the address of the GV or the address of the pad slot of the iteration variable in the CX struct, so we can quickly access and update it in pp_iter. For the ITHREADS case however, the pad may change if the thread is cloned, so instead the address of PL_comppad was stored, and then updated during cloning. This meant that on each iter, we would have to retrieve the saved PL_comppad address from the ctx struct, retrieve the targ from the saved my_op, and do a (perlish) array indexing. Thuis commit makes this faster by, for the ITHREADS case, storing both PL_comppad and svp = &PLcurpad[targ]. In pp_iter(), we're fast by directly accessing *svp; while storing PL_comppad allows us to update both it and svp during thread cloning. This requires one extra pointer in the block_loop part of the context union under threads, but this is already smaller than some other parts of the union, so has no effect. Note that the oldcomppad field was formerly part of the itervar_u union, but is now a separate field within the larger block_loop struct (but only on threaded builds). Note also that the tests I've added I retrieved from an old WIP private branch that contained a forerunner of this commit, so they may not be entirely relevant to the current form of this commit. But extra tests can never hurt, so I've included them.
* PerlIO::encoding: explicitly cast char * to STDCHAR *Lukas Mai2016-01-312-3/+3
| | | | | This should avoid the "pointer targets in assignment differ in signedness" warning that pops up in some configurations.
* Skip SA_SIGINFO uid/pid test on POSIX-deficient OS X versionsDagfinn Ilmari Mannsåker2016-01-291-0/+2
|
* ext/POSIX/lib/POSIX.pod: Make verbatim line fit in 79 colsKarl Williamson2016-01-271-2/+2
|
* fix link failure of APItest.dll on VC 6Daniel Dragan2016-01-271-1/+1
| | | | | | alloca is the newer "standardized" name which modern VCs support. In VC 6, only _alloca exists, which is the prestandardized name, use it to fix a linker failure.
* Revert "[perl #126632] more diagnostics"Tony Cook2016-01-271-8/+2
| | | | | | | | This reverts commit ef18391745841fb1df298cec3a3001be4237fb3d. This commit was intended only to diagnose Jenkins build issues, I now have better access to Jenkins (and the new diagnostics didn't tell me much anyway.)
* Probe for and expose more fields for SA_SIGINFODagfinn Ilmari Mannsåker2016-01-261-5/+26
| | | | | | | | These are all specified by POSIX/SUSv3, but not all platforms have them, as mentioned in POSIX.pm. We can only test the pid, uid and code fields, since they are the only ones that are defined for a user-sent signal.
* Add SA_SIGINFO 'code' constants to POSIXDagfinn Ilmari Mannsåker2016-01-264-1/+47
| | | | | Mention them in the sigaction documentation, and document the 'addr' field.
* [perl #126632] more diagnosticsTony Cook2016-01-261-2/+8
| | | | Some of this will be removed once we work out what's going on.
* [perl #121351] Remove non-doio.c uses of PL_statbufDagfinn Ilmari Mannsåker2016-01-252-2/+3
| | | | | These are the last remaining uses outside the interwoven mess in S_openn_cleanup, openn_setup, and their callers in doio.c.
* [perl #126632] improve diagnostics for the comctl32 testTony Cook2016-01-251-1/+3
|