This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Karl Williamson [Wed, 5 Apr 2023 00:58:51 +0000 (18:58 -0600)]
locale.c: Add commit number to comments
to refer to details of the problem
Karl Williamson [Sun, 5 Mar 2023 13:03:13 +0000 (06:03 -0700)]
perl.h: White space, comments only
Elvin Aslanov [Mon, 17 Jul 2023 11:25:16 +0000 (13:25 +0200)]
Remove the duplicate "to"
Correct spelling in comments
Karl Williamson [Sun, 10 Jul 2022 17:12:15 +0000 (11:12 -0600)]
pp.c: Use utf8_hop_back instead of rolling our own
This is inlined, so shouldn't be any slower, and fixing bugs will be
done in a single place
Karl Williamson [Mon, 17 Jul 2023 01:17:54 +0000 (19:17 -0600)]
utf8_hop_back: Check before derefencing
This conditional derefenced before checking if it is safe to dereference
Karl Williamson [Sat, 10 Sep 2022 17:50:40 +0000 (11:50 -0600)]
locale.c: Add missing mutex locks
This adds locks around mbrtowc and reading the environment that a code
review indicated were missing. The mbrtowc lock is currently a no-op,
but a future commit will change that. The other lock is in code rarely
compiled.
Graham Knop [Tue, 6 Jun 2023 11:19:12 +0000 (13:19 +0200)]
Pod-Perldoc: exclude corpus files that are not used for anything
The Pod-Perldoc distribution includes several files in its corpus
directory but which aren't used for anything. They appear to be for
manual testing. There is little reason to include them in core.
Additionally, one of the files included is an old copy of perlfunc.pod,
which continually confuses contributors to core.
Elvin Aslanov [Sun, 9 Jul 2023 17:03:52 +0000 (19:03 +0200)]
config.yml: RFC -> PPC
Rename in "url" and "about"
Lukas Mai [Sun, 16 Jul 2023 18:22:27 +0000 (20:22 +0200)]
perl5100delta: document removal of 'package;' syntax
The 'package;' (null package) syntax that was deprecated in perl 5.8 was
removed in 5.10, but there is no mention of it in the perldeltas. Until
now.
Yves Orton [Sun, 16 Jul 2023 13:03:16 +0000 (15:03 +0200)]
regen/HeaderParser.pm - friendly perl version check
If the installed version of perl is too old then HeaderParser.pm
will die because it uses named capture buffers. We could do a "standard"
version assertion, but doing it this way makes for a more user friendly
error message.
Karl Williamson [Fri, 7 Apr 2023 15:18:35 +0000 (09:18 -0600)]
locale.c: Move setting errno out of critical section
I doesn't matter much, but its better practice to make critical sections
as small as possible.
Karl Williamson [Wed, 5 Apr 2023 16:18:44 +0000 (10:18 -0600)]
locale.c: Improve collation debugging output
This adds a special case for when the buffer is empty
Karl Williamson [Sun, 2 Apr 2023 09:51:09 +0000 (03:51 -0600)]
Perl__byte_dump_string(): Properly handle NULL input
Instead of an assert, this returns (nil) and things can proceed.
Tony Cook [Wed, 5 Jul 2023 04:31:42 +0000 (14:31 +1000)]
mingw64 ci: install a fresh mingw64 and use it
This is far from perfect but should let us become less accustomed to
red crosses due to mingw64.
The installation of mingw64 is slow, hopefully a future change will
let us use the github workflow caching mechanism.
Tony Cook [Tue, 11 Jul 2023 00:20:15 +0000 (10:20 +1000)]
win32: make win32 FILE access macros depend on libc instead of compiler
Thanks to xenu for information on the macro used here.
Tony Cook [Wed, 12 Jul 2023 05:00:21 +0000 (15:00 +1000)]
Revert "use the linker to link generate_uudmap$(EXE)"
This introduced smoke failures on AIX and HP-UX, for example on AIX:
[2023-07-11 23:38:52METDST] xlc_r -q64 -c -DPERL_CORE -q64 -DDEBUGGING -DPERL_DONT_CREATE_GVSV -qlanglvl=extended -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -DDEBUGGING -I/pro/local/include -q64 -DUSE_64_BIT_ALL -q64 -O -g generate_uudmap.c
[2023-07-11 23:38:52METDST] ld -o generate_uudmap -L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64 generate_uudmap.o -lpthread -lbind -ldl -lld -lm -lcrypt -lpthreads -lc
[2023-07-11 23:38:52METDST]
[2023-07-11 23:38:52METDST] If you compile perl5 on a different machine or from a different object
[2023-07-11 23:38:52METDST] directory, copy the Policy.sh file from this object directory to the
[2023-07-11 23:38:52METDST] new one before you run Configure -- this will help you with most of
[2023-07-11 23:38:52METDST] the policy defaults.
[2023-07-11 23:38:52METDST] 5.39.0 <=> 5.014002
[2023-07-11 23:38:52METDST] ===== PROCURA Policy for aix/cc ========================
[2023-07-11 23:38:52METDST] ===== PROCURA Policy results ============================
[2023-07-11 23:38:52METDST] cc: xlc_r
[2023-07-11 23:38:52METDST] ccversion: -
[2023-07-11 23:38:52METDST] gccversion: -
[2023-07-11 23:38:52METDST] ccflags: -q64 -DDEBUGGING -DPERL_DONT_CREATE_GVSV -qlanglvl=extended
[2023-07-11 23:38:52METDST] optimize:
[2023-07-11 23:38:52METDST] ld:
[2023-07-11 23:38:52METDST] ldflags: -L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib
[2023-07-11 23:38:52METDST] libswanted: cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb bsd BSD
[2023-07-11 23:38:52METDST] libsdirs: /usr/local/ppc64/lib64 /lib /pro/local/lib
[2023-07-11 23:38:52METDST] locincpth: /pro/local/include
[2023-07-11 23:38:52METDST] loclibpth: /usr/local/ppc64/lib64
[2023-07-11 23:38:52METDST] useshrplib:
[2023-07-11 23:38:52METDST] ===== PROCURA Policy done ===============================
[2023-07-11 23:38:52METDST] ld: 0706-012 The -q flag is not recognized.
[2023-07-11 23:38:52METDST] ld: 0706-012 The -6 flag is not recognized.
[2023-07-11 23:38:52METDST] ld: 0706-012 The -4 flag is not recognized.
[2023-07-11 23:38:52METDST] make: *** [generate_uudmap] Error 255
and HP-UX:
[2023-07-12 02:09:20+0200] ccache cc -c -DPERL_CORE -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -Wp,-H150000 -DDEBUGGING +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -DDEBUGGING -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit -g generate_uudmap.c
[2023-07-12 02:09:20+0200] /usr/bin/ld -o generate_uudmap -L/pro/local/lib +DD64 -L/usr/lib/hpux64 generate_uudmap.o -lcl -lpthread -ldl -lm -lsec -lc
[2023-07-12 02:09:20+0200]
[2023-07-12 02:09:20+0200] If you compile perl5 on a different machine or from a different object
[2023-07-12 02:09:20+0200] directory, copy the Policy.sh file from this object directory to the
[2023-07-12 02:09:20+0200] new one before you run Configure -- this will help you with most of
[2023-07-12 02:09:20+0200] the policy defaults.
[2023-07-12 02:09:20+0200] 5.39.0 <=> 5.026002
[2023-07-12 02:09:20+0200] ===== PROCURA Policy for hpux/ccache cc ========================
[2023-07-12 02:09:20+0200] ===== PROCURA Policy results ============================
[2023-07-12 02:09:20+0200] cc: ccache cc
[2023-07-12 02:09:20+0200] ccversion: -
[2023-07-12 02:09:20+0200] gccversion: -
[2023-07-12 02:09:20+0200] ccflags: -DDEBUGGING +Z -z
[2023-07-12 02:09:20+0200] optimize:
[2023-07-12 02:09:20+0200] ld:
[2023-07-12 02:09:20+0200] ldflags: -L/pro/local/lib
[2023-07-12 02:09:20+0200] libswanted: cl pthread cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb bsd BSD
[2023-07-12 02:09:20+0200] libsdirs: /lib /pro/local/lib
[2023-07-12 02:09:20+0200] locincpth: /pro/local/include
[2023-07-12 02:09:20+0200] loclibpth: /pro/local/lib
[2023-07-12 02:09:20+0200] useshrplib:
[2023-07-12 02:09:20+0200] ===== PROCURA Policy done ===============================
[2023-07-12 02:09:20+0200] ld: Unrecognized argument: +DD64
[2023-07-12 02:09:20+0200] Fatal error.
[2023-07-12 02:09:20+0200] make: *** [generate_uudmap] Error 1
This reverts commit
07e3b5cdb6f7260446b791acf0623e01a37e4739.
Karl Williamson [Thu, 16 Mar 2023 13:18:45 +0000 (07:18 -0600)]
locale.c: Add warning if function return ignored
Karl Williamson [Mon, 19 Dec 2022 11:10:21 +0000 (04:10 -0700)]
locale.c: configthreadlocale() error checking
The code previously just assumed the system call always worked. But it
may not if the CRTL is wrong; this surfaced on a mingw compile.
It's better to have it fail outright than to continue and silently give
a wrong answer.
Karl Williamson [Mon, 3 Jul 2023 23:14:26 +0000 (17:14 -0600)]
loc_tools: Add check for ISO-8859
Previously the dashless version was tested, leading to some missed
locales on some systems.
Karl Williamson [Mon, 3 Jul 2023 23:03:44 +0000 (17:03 -0600)]
loc_tools: Always check for C.UTF-8 locale
On many platforms this is a basic included locale, and there is even a
Configure probe for its existence, which we can take advantage of.
Karl Williamson [Mon, 3 Jul 2023 23:02:51 +0000 (17:02 -0600)]
loc_tools: Add input param check to external function
Karl Williamson [Mon, 3 Jul 2023 22:18:13 +0000 (16:18 -0600)]
loc_tools: White space only
Indent because the previous commit formed a new block around this code.
Karl Williamson [Mon, 3 Jul 2023 20:37:59 +0000 (14:37 -0600)]
loc_tools.pl: Cache results
Some of the functions in this file are slow, because it speculatively
tries various potential somewhat commonly-encountered locales to see
which ones actually work on this platform.
On many boxes, much of the potential list can be quickly gathered from a
call to a system command, but on other platforms, including Windows, the
list comes from trying all the possibilities in the <DATA> section of
the file, including permutations.
And the determination that each locale actually works takes time.
So this commit caches the list of available locales it finds, avoiding
doing all this work again if the calling test program calls it again.
Karl Williamson [Fri, 7 Apr 2023 13:38:48 +0000 (07:38 -0600)]
locale.c: Use wider than U32 for a counter
Processes that change locales are incrementing a counter that could
eventully wrap if the process is long-lived. It's not likely, but it's
also easy to make this a U64 if available, and make the chances of it
happening much closer to zero.
Karl Williamson [Fri, 7 Apr 2023 15:21:17 +0000 (09:21 -0600)]
get_win32_message_utf8ness() Fix unlikely case
This function calls get_locale_string_utf8ness_i(). The API of that
function changed earlier in the 5.37 series, and this was not updated to
correspond. It is calling it with category 0, which it thinks is an
out-of-bounds value, but it really is LC_ALL on Windows. Thus it
actually probably doesn't lead to a failure, but it theoretically could
fail if LC_ALL is not uniform.
So it's better to not succeed just by accident. This commit changes to
now use LC_CTYPE as the category. And if someone has managed to compile
Windows without LC_CTYPE, it now just says that the input string isn't
UTF-8, as without LC_CTYPE, you've only got the C locale.
Karl Williamson [Thu, 6 Apr 2023 22:39:23 +0000 (16:39 -0600)]
locale.c: Only compile workaround on platforms needing it
This code works around a bug on Windows with regard to localeconv().
And the bug only exists on such platforms that have thread-safety.
Prior to this commit, the code was compiled on platforms lacking
thread-safety, so was unnecessary.
James E Keenan [Mon, 3 Jul 2023 21:13:28 +0000 (17:13 -0400)]
Release schedule for 5.39 dev cycle
Skeleton only; no assignments yet.
Tomasz Konojacki [Mon, 5 Jun 2023 19:07:28 +0000 (21:07 +0200)]
XSUB.h: remove setjmp and longjmp overrides
Those redefinitions are in effect only when PERL_IMPLICIT_SYS is defined
(pretty much only on Windows) and they're broken (circular) when
HAS_SIGSETJMP isn't defined (e.g. on Windows). Also, even if they
weren't broken, they don't provide any value.
The workaround in threads.xs for this issue is still needed, because
it's a dual-life module and it's supposed to work on older Perls.
However, it can be simplified by defining NO_XSLOCKS to suppress the
redefinitions.
Fixes #21039
Karl Williamson [Sat, 31 Dec 2022 22:08:22 +0000 (15:08 -0700)]
perl.h: Create a locale mnemonic #define for sync across files
Karl Williamson [Fri, 12 May 2023 00:56:10 +0000 (18:56 -0600)]
perl.h: Add DISABLE_LC_NUMERIC_CHANGES macro
This is for code that needs to keep other code from changing LC_NUMERIC
out from under it, but avoids the knowledge of PL_numeric_standard,
which is used when perl controls the locale handling.
This is designed for 'version' (vutil.c) to use, because it has to
operate seamlessly in the mode where perl controls the handling, and
when it doesn't, even if it doesn't know it doesn't.
Karl Williamson [Tue, 20 Jun 2023 17:34:45 +0000 (11:34 -0600)]
A broken localeconv() doesn't depend on being threaded
Earlier Windows and Mingw have a broken localeconv() libc function.
This breakage occurs on unthreaded builds too.
Karl Williamson [Mon, 12 Jun 2023 18:27:30 +0000 (12:27 -0600)]
regen/unicode_constants.pl: Add Arabic radix
This will be helpful to vutil.c
Karl Williamson [Sun, 25 Jun 2023 07:30:49 +0000 (01:30 -0600)]
regen/unicode_constants.pl: Add generating first byte as string
This enhances this utility script to have the capability of getting the
first byte of a UTF-8 string expressed as a literal (single-byte) string
itself.
Karl Williamson [Mon, 28 Nov 2022 17:45:56 +0000 (10:45 -0700)]
locale.c: Work around a Win32 bug in localeconv()
If the locale for an individual category is set, and then the locale for
LC_CTYPE is set afterwards, it trashes (at least partially), the first
category's setting for the purposes of localeconv(). This can happen
even if LC_CTYPE is the same locale as that of the other category.
This commit implements a workaround for that, where LC_CTYPE is set,
then the other cateorgy's locale is switched to C, then to whatever is
should be. The problem doesn't seem to happen if the destination
locale is C.
I have a short C-language reproducer program that doesn't involve Perl,
but I haven't submitted it to Microsoft due to my cynicism about them
patying any attention to it.
Karl Williamson [Sat, 8 Apr 2023 13:52:18 +0000 (07:52 -0600)]
Need threads to use cur_locale obj
On Configurations that are very unlikely to be seen in the wild, these
bits of code were attempted to be compiled when they weren't actually
needed, leading to undefined symbols compilation errors.
The configuration basically involved requiring the POSIX 2008 locale
thread-safe API when no threads are in use.
Karl Williamson [Fri, 7 Apr 2023 15:54:40 +0000 (09:54 -0600)]
perlapi: Improve wording for Perl_langinfo()
Karl Williamson [Tue, 30 May 2023 12:54:08 +0000 (06:54 -0600)]
XS-APItest/t/locale.t: White space only
Indent to correspond with a new block added in the previous commit
Karl Williamson [Tue, 30 May 2023 12:52:52 +0000 (06:52 -0600)]
XS-APItest/t/locale.t: Skip tests if pre-req not met
Rather than have them all failing, if the test that tries to set things
up fails, skip the ones that depend on it having succeeded
H.Merijn Brand [Mon, 10 Jul 2023 09:02:54 +0000 (11:02 +0200)]
Add distribution-friendly make message (PR#21207)
by Elvin Aslanov (rwp0)
Straight to the point as "Public domain implementation" wasn't very helpful.
Came across this message building Perl on a freshly installed Ubuntu Linux doing:
git clone https://github.com/Perl/perl5
sh Configure -des -Dusedevel
James E Keenan [Mon, 10 Jul 2023 01:36:08 +0000 (21:36 -0400)]
Insert missing apostrophe
As reported by Keith Thompson in https://github.com/Perl/perl5/issues/21203
Karl Williamson [Sun, 9 Jul 2023 18:52:22 +0000 (12:52 -0600)]
Fix compilation with NO_LOCALE
Commit
c164c467952dd4fb7b81b3030f8ccc445ae438a8 causes the compilation
to fail on platforms that do not have locales enabled.
The enum's start is only done when there are locales, while the enum's
ending is done regardless, leaving the start missing when no locales.
This commit fixes that.
Karl Williamson [Wed, 5 Apr 2023 01:12:24 +0000 (19:12 -0600)]
locale.c: Rmv unexecuted statement after croak
And it is misleading to have it.
Paul "LeoNerd" Evans [Sun, 9 Jul 2023 10:52:34 +0000 (11:52 +0100)]
Document the relative order of version and attributes to the class keyword
Paul "LeoNerd" Evans [Sun, 9 Jul 2023 10:30:07 +0000 (11:30 +0100)]
Fix up link to renamed PPC document
Karl Williamson [Sun, 10 Jul 2022 20:29:27 +0000 (14:29 -0600)]
regexec.c: Use utf8_hop_safe() instead of rolling our own
Karl Williamson [Sun, 10 Jul 2022 16:57:42 +0000 (10:57 -0600)]
sv.c: Use utf8_hop instead of rolling our own
The inlined functions should be no slower than the hand rolling, and the
code is easier to maintain, with better handling of malformed input.
Karl Williamson [Sun, 10 Jul 2022 16:56:09 +0000 (10:56 -0600)]
sv.c: Fix, clarify comment
Karl Williamson [Tue, 13 Jun 2023 17:35:07 +0000 (11:35 -0600)]
locale.c: Win32 also can determine the codeset
This code adds the codeset detail to debugging statements. It didn't
change when the ability to find the codeset on Windows platforms was
added, so the detail was ommited for them, until this commit.
Lukas Mai [Sat, 8 Jul 2023 07:39:19 +0000 (09:39 +0200)]
perlhacktips: run podtidy for consistent formatting
... like the comment at the beginning of the file claims.
Lukas Mai [Sat, 8 Jul 2023 07:23:20 +0000 (09:23 +0200)]
perlhacktips: copy editing
- use F<> for filenames, not C<>
- use L<> for URLs and module names to create clickable links in
renderers that support it
- change "C<hdr> files" to "header files" everywhere
- update old links (new domains, http -> https, etc)
- use C<> for code snippets and type names in C
- use C<> for environment variables
- possessive "it's" -> "its"
- "cleanup" (verb) -> "clean up"
- add link to mod_perl documentation
- random noun/verb agreements and punctuation
Karl Williamson [Fri, 7 Jul 2023 00:22:01 +0000 (18:22 -0600)]
regexp.h: Add missing =cut after pod in comment
Yves Orton [Thu, 6 Jul 2023 14:31:11 +0000 (16:31 +0200)]
perlreapi.pod - update docs regex offset data
RX_OFFS() was renamed RX_OFFSp() as only the internals should be using it.
The newer macros RX_OFFS_START() and RX_OFFS_END() and RX_OFFS_VALID() are
the correct way to do the same thing that used to be done with RX_OFFS().
Any code using RX_OFFSp() outside of the internals will likely end up doing
the wrong thing, it is provided only for internals use.
Fixes #21213
Yves Orton [Thu, 6 Jul 2023 14:01:46 +0000 (16:01 +0200)]
perlguts.pod - s/MORTALDESTRUCTOR_X/MORTALSVFUNC_X/g
This macro was renamed during development, but these two references in the
docs were overlooked.
Fixes #21215
Karl Williamson [Thu, 6 Jul 2023 01:47:39 +0000 (19:47 -0600)]
perlapi: 'resume_compcv' doesn't exist
I presume what was meant here is 'resume_compcv_final'
Karl Williamson [Thu, 6 Jul 2023 00:05:10 +0000 (18:05 -0600)]
perlapi: Fix grammar included from scope.h
Karl Williamson [Thu, 6 Jul 2023 00:03:58 +0000 (18:03 -0600)]
scope.h: Fix typos in apidoc lines
Two words on each line got wrongly tied together with an underscore
Karl Williamson [Thu, 6 Jul 2023 00:01:28 +0000 (18:01 -0600)]
embed.fnc: Remove duplicate comment text
This is repeated a few lines below, and is more natural there.
Bernd [Tue, 4 Jul 2023 08:44:31 +0000 (10:44 +0200)]
Fix typo in pumpkin.pod
Bernd [Tue, 4 Jul 2023 11:07:24 +0000 (13:07 +0200)]
Fix typo in perl5380delta.pod
Karl Williamson [Mon, 28 Nov 2022 16:56:44 +0000 (09:56 -0700)]
perl.h: define locale mutex under more cirumstances
Prior to this commit, it wasn't defined if we aren't paying attention to
locales; but that doesn't mean they don't exist, and the operations that
affect them are still callable; so they should have a mutex to prevent
one thread from overwriting another's.
Tony Cook [Wed, 28 Jun 2023 04:37:58 +0000 (14:37 +1000)]
bump $Time::HiRes::VERSION
Tony Cook [Wed, 28 Jun 2023 04:22:26 +0000 (14:22 +1000)]
Time-HiRes: don't warn in C++ builds
g++ warns here:
warning: option ‘-Wc++-compat’ is valid for C/ObjC but not
for C++ [-Wpragmas]
so don't try to suppress this warning for C++ builds.
Tony Cook [Tue, 4 Jul 2023 05:04:35 +0000 (15:04 +1000)]
perldelta for
576cb40592d
Tony Cook [Thu, 13 Apr 2023 03:43:59 +0000 (13:43 +1000)]
reset(): call set magic when clearing SVs
reset() with an argument would clear the specified SVs when requested
but didn't call set magic, this would result in the effect on magic
variables not applying, such as the $| and $^W used in the ticket.
This isn't a problem for AVs and HVs as their corresponding clear
functions do call the appropriate clear magic.
Fixes #20763
Tony Cook [Wed, 19 Apr 2023 06:45:08 +0000 (16:45 +1000)]
embed.fnc: mark uvuni_to_utf8() as a mathom
This was causing builds with -DNO_MATHOMS to fail on Win32,
makedef.pl would generate an export, but since the definition
is in mathoms.c linking would fail.
Tony Cook [Tue, 4 Jul 2023 04:01:58 +0000 (14:01 +1000)]
bump $warnings::VERSION
Tony Cook [Tue, 4 Jul 2023 04:01:33 +0000 (14:01 +1000)]
bump $POSIX::VERSION
Tony Cook [Tue, 4 Jul 2023 03:51:59 +0000 (13:51 +1000)]
perldelta for
2fea725777ae
Karl Williamson [Fri, 28 Apr 2023 18:41:01 +0000 (12:41 -0600)]
test.pl: Add comment that you should clear watchdog
As it says, failure to cancel a timer can lead to failing (or worse:
flapping) tests
Karl Williamson [Fri, 28 Apr 2023 18:40:59 +0000 (12:40 -0600)]
test.pl: Clarify comments
Lukas Mai [Sun, 30 Apr 2023 10:22:14 +0000 (12:22 +0200)]
POSIX: fix compiler warnings on windows
This should fix the following warnings:
POSIX.c: In function 'XS_POSIX__Termios_getattr':
POSIX.c:2126:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.c: In function 'XS_POSIX__Termios_setattr':
POSIX.c:2182:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.c: In function 'XS_POSIX__Termios_getispeed':
POSIX.c:2249:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.c: In function 'XS_POSIX__Termios_getiflag':
POSIX.c:2281:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.c: In function 'XS_POSIX__Termios_getcc':
POSIX.c:2334:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.c: In function 'XS_POSIX__Termios_setispeed':
POSIX.c:2374:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.c: In function 'XS_POSIX__Termios_setiflag':
POSIX.c:2416:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.c: In function 'XS_POSIX__Termios_setcc':
POSIX.c:2464:17: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
termios_ref = (POSIX__Termios)SvPV_nolen(SvRV(sv));
^
POSIX.xs: In function 'XS_POSIX_ctermid':
POSIX.xs:1462:20: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define ctermid(x) (char *) not_here("ctermid")
^
POSIX.xs:3639:11: note: in expansion of macro 'ctermid'
RETVAL = ctermid(s);
^~~~~~~
POSIX.c: In function 'XS_POSIX_ttyname':
POSIX.xs:1383:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
# define ttyname(a) (char*)not_here("ttyname")
^
POSIX.c:5453:11: note: in expansion of macro 'ttyname'
RETVAL = ttyname(fd);
^~~~~~~
Eugen Konkov [Fri, 2 Jun 2023 12:50:46 +0000 (08:50 -0400)]
Updated .mailmap
Eugen Konkov [Tue, 6 Jun 2023 15:34:48 +0000 (11:34 -0400)]
Added example how to zero-pad floating-point number
Hugo van der Sanden [Thu, 8 Jun 2023 01:58:55 +0000 (02:58 +0100)]
squashme: rename stub new to open
Keep things consistent.
Hugo van der Sanden [Thu, 1 Jun 2023 20:19:58 +0000 (21:19 +0100)]
bump versions for warnings and warnings::register
Hugo van der Sanden [Thu, 1 Jun 2023 17:56:54 +0000 (18:56 +0100)]
warnings doc improvements
- fix a couple of typos;
- clarify that 'use warnings' enables even warnings that have not yet
been registered;
- rename function name in an example, since a later reference relates
to the same function from a previous example;
- link to a more specific point from warnings::register
James Raspass [Wed, 7 Jun 2023 10:18:08 +0000 (11:18 +0100)]
Correct grammar in perlfunc.pod - select
Karl Williamson [Mon, 3 Jul 2023 23:06:14 +0000 (17:06 -0600)]
loc_tools: Fix typo in comment
Tony Cook [Tue, 4 Jul 2023 00:33:14 +0000 (10:33 +1000)]
Suppress various header build warnings on MSVC with /W4
These prevents noise for downstream embedders.
PR #21031
Tony Cook [Tue, 18 Apr 2023 23:18:52 +0000 (09:18 +1000)]
SvPVXtrue(): mark the context parameter as unused
Tony Cook [Mon, 17 Apr 2023 01:39:52 +0000 (11:39 +1000)]
cop.h: suppress padding warning from MSVC
MSVC complained about this code:
cop.h(34): warning C4324: 'jmpenv': structure was padded due to alignment specifier
which happens due to the jmpbuf structure in MSVC having an
alignment attribute set.
Tony Cook [Thu, 13 Apr 2023 00:46:05 +0000 (10:46 +1000)]
win32.h: eliminate anonymous union (C11 feature)
This warned on MSVC:
win32.h(277): warning C4201: nonstandard extension used: nameless struct/union
Tony Cook [Thu, 13 Apr 2023 00:22:56 +0000 (10:22 +1000)]
inline.h: prevent cast warning on MSVC
MSVC complains about truncation (it isn't truncation) when casting
the pointer to bool.
Tony Cook [Wed, 12 Apr 2023 04:33:06 +0000 (14:33 +1000)]
sv_isbool(): mark the context parameter unused
This warned on MSVC
Tony Cook [Wed, 12 Apr 2023 03:59:13 +0000 (13:59 +1000)]
foldEQ(), foldEQ_latin1(): mark the context as unused
These functions are also used as pointers, so we need to retain the
context parameter to be compatible with the other similar functions
that do use their context.
Tony Cook [Tue, 4 Apr 2023 23:14:01 +0000 (09:14 +1000)]
inline.h: eliminate conversion warnings
Setting si_cxsubix in the context helper functions from the
difference of two pointers on 64-bit builds produced warnings
on MSVC like:
inline.h(2815): warning C4244: '=': conversion from '__int64' to 'I32', possible loss of data
Similar warnings are produced on gcc with -Wconversion (and many more)
The machine that needs 2**32 context entries would also require
much more memory to store the contexts themselves and any SVs and
stack entries needed within each context, so I've cast the
values rather than making si_cxsubix a SSize_t.
Fixes parts of #20841, preventing this warning when the header is
used by embedders or extension builders.
Tony Cook [Tue, 4 Apr 2023 23:01:04 +0000 (09:01 +1000)]
utf8.h: prevent cast truncation warning on MSVC for continuation mask
Building with /W4 on MSVC would produce a warning like:
inline.h(309): warning C4310: cast truncates constant value
While the casting here is harmless, it's reasonable to eliminate
warnings caused by headers that embedders or extension builders might
use.
Fixes #20999
Tony Cook [Wed, 24 May 2023 01:57:22 +0000 (11:57 +1000)]
use the linker to link generate_uudmap$(EXE)
Recent versions of clang++ complain when building .c files as
C++:
clang-16: warning: treating 'c' input as 'c++' when in C++ mode,
this behavior is deprecated [-Wdeprecated]
The solution for this would be to Configure with:
./Configure ... -Dcc=clang++\ -xc++ -Dld=clang++
this results in the link stage for generate_uudmap trying to compile
generate_uudmap.o as C++ and hilarity ensues.
Fix this by using the linker to link.
Tony Cook [Tue, 4 Jul 2023 00:17:07 +0000 (10:17 +1000)]
perldelta for
dcc4b625fb9
Tony Cook [Sun, 14 May 2023 23:36:57 +0000 (09:36 +1000)]
perlhacktips: C99, but not array designators nor compound literals
The second came up while trying to get perl to build as C++ in
MSVC 2022.
Addresses #21073 (but isn't a fix)
Tony Cook [Wed, 31 May 2023 06:35:21 +0000 (16:35 +1000)]
bump $EU::CBuilder::*VERSION and update Changes
Tony Cook [Wed, 31 May 2023 06:26:47 +0000 (16:26 +1000)]
EU::CBuilder: add a prototype to the test code for have_compiler()
The C code used to probe for a working compiler defined a function
without a prototype, which could cause warning noise when
used. Add a prototype.
Tony Cook [Mon, 3 Jul 2023 23:29:00 +0000 (09:29 +1000)]
Tony Cook [Mon, 3 Jul 2023 23:20:40 +0000 (09:20 +1000)]
libperl.t: remove the now obsolere skip on darwin
Tony Cook [Mon, 29 May 2023 01:28:12 +0000 (11:28 +1000)]
libperl.t: eliminate the rest of the noise on recent Darwin
l_switch.table.S_set_regex_pv.3163
l___const.S_pmtrans.PL_partition_by_byte_length *
l___const.S_my_localeconv.lconv_integers *
and the [cold func] entries.
The symbols marked * above may indicate an optimisation opportunity,
such symbols reference initialisation data for auto constant data
structures within the function, which is initialised by copy on
each function entry.
Tony Cook [Wed, 24 May 2023 03:22:38 +0000 (13:22 +1000)]
porting/libperl.t: handle nm output on Mac OS Ventura 13.4
Fixes #21117
Elvin Aslanov [Tue, 6 Jun 2023 18:54:03 +0000 (20:54 +0200)]
perlfunc.pod: Correct getpwnam example
Fixes Perl/perl5#21137
Karl Williamson [Sun, 23 Apr 2023 15:32:45 +0000 (09:32 -0600)]
op/sub.t: Cancel watchdog when done
A watchdog timer should be cancelled after the test(s) it guards.
Otherwise, when someone adds new tests after it in the file, and doesn't
notice that the tests are under the watchdog, those new tests can fail.
These failures may be intermittent, only happening under heavy load.
Karl Williamson [Wed, 12 Apr 2023 14:22:52 +0000 (08:22 -0600)]
locale.c: Always leave a space for LC_ALL entries
Some platforms may not have the LC_ALL conglomerate category. This
commit leaves a placeholder for it anyways. Having this always there
can lead to some simplifications.
Karl Williamson [Wed, 12 Apr 2023 12:09:00 +0000 (06:09 -0600)]
perl.h: Use an enum to simplify consecutive value initialization
This commit replaces the clumsy method to initialize some symbols with
consecutive vaues. This also presents opportunities to declare
variables as the particular enum type, to allow for better checking and
code generation.