This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
9 years agoPATCH: [perl #122090] Non-word-boundary doesn't match EOS
Karl Williamson [Mon, 23 Jun 2014 01:52:59 +0000 (19:52 -0600)]
PATCH: [perl #122090] Non-word-boundary doesn't match EOS

The root cause of this is that the loop is a "< strend" instead of a
"<=".  However, the macro that is called to form the loop is used
elsewhere where "<" is appropriate.  So I opted to just repeat the
small salient portions of the loop right after it so it gets executed
one final time in the final position.

This code:
 if ((!prog->minlen && tmp) && (reginfo->intuit || regtry(reginfo, &s))) \
           goto got_it;
had the effect previously of causing \b to look at the position just
after the string, but not \B.  By doing it the other way, this is no
longer needed, except I don't understand the prog->minlen portion.  It
isn't used anywhere else in the tests which see if one should goto
got_it, nor do any test suite tests fail by removing it.  I think it is
a relic, but if a bisect should end up blaming this commit, I'd start
with that.

9 years agoregexec.c: Comments and white-space only
Karl Williamson [Mon, 23 Jun 2014 01:51:11 +0000 (19:51 -0600)]
regexec.c: Comments and white-space only

9 years agoregexec.c: Exchange 2 lines of code and add comments
Karl Williamson [Mon, 23 Jun 2014 01:48:23 +0000 (19:48 -0600)]
regexec.c: Exchange 2 lines of code and add comments

This reorders things to avoid unnecessary work, as the now-first line
may jump, making the assignment that used to be unconditional irrelevant

9 years agoregexec.c: More cleaning of FBC macro/code interface
Karl Williamson [Mon, 23 Jun 2014 01:41:25 +0000 (19:41 -0600)]
regexec.c: More cleaning of FBC macro/code interface

The definition of \w is now compiled into the Perl core.  This allows
the complicated swash_fetch function call to be replaced by
isWORDCHAR_utf8, which takes a single parameter, so the interface can be
simplified. [1].

This macro will execute faster on Latin1-range inputs, as it doesn't do
a swash_fetch on them, but slower on other code points due to function
call overhead, and some currently in-place error checking that wasn't
done previously.  This overhead could be removed by using inline
functions, and perhaps a different interface for known non-malformed
input (though I'm actually not sure the input is known to be well-formed
in this case).

These macros still depend on and modify outside variables.  That could
be cleaned up by adding additional parameters to them, but I'm not going
to do it now.  I don't like these kinds of code-generating macros, and
have been tempted to rewrite these as inline functions, but it's not a
trivial task to do.

[1] I hadn't realized it before, but the interface could have been
cleaned up instead by introducting a macro that makes it look like a
single parameter is used uniformly to existing macros, looking like
 #define FBC_BOUND_SWASH_FETCH(s)  \
    cBOOL(swash_fetch(PL_utf8_swash_ptrs[_CC_WORDCHAR], s, utf8_target))
But it seems better to me to use isWORDCHAR_utf8 as it is faster for
Western European languages, and can be made nearly the same speed as the
alternative if experience tells us that this is a slow spot that should
be sped up.

9 years agoregexec.c: Clean up macro/code interface slightly
Karl Williamson [Mon, 23 Jun 2014 01:13:10 +0000 (19:13 -0600)]
regexec.c: Clean up macro/code interface slightly

These code-generating macros are a pain to maintain.  These have side
effects and use variables outside the macros.  This commit cleans up the
interface slightly by separating the operand of a function from the
function, so the code outside doesn't have to know as much about the
macro as before.  The next commit will fix up the remaining parameter
like this.

9 years agoregexec.c: Change names of 4 macros
Karl Williamson [Mon, 23 Jun 2014 00:58:39 +0000 (18:58 -0600)]
regexec.c: Change names of 4 macros

The names were misleading; they were not for general use, but only for
this FBC area of the code, and they no longer have to do with having to
load utf8 or not.

9 years agoregexec.c: Change MiXeD cAsE formal macro parameters
Karl Williamson [Sun, 22 Jun 2014 03:53:03 +0000 (21:53 -0600)]
regexec.c: Change MiXeD cAsE formal macro parameters

I find these a pain to type and read, and there is no reason for them.
As formal parameters there is no possibility of conflict with the code
outside them.  And I'm about to do some editing of these, so this change
will make that easier.

9 years agoSync Module-CoreList version in Maintainers.pl for CPAN release
Chris 'BinGOs' Williams [Thu, 26 Jun 2014 09:13:38 +0000 (10:13 +0100)]
Sync Module-CoreList version in Maintainers.pl for CPAN release

9 years agoFollow-up to 51f14a05: not ignoring my_snprintf return values.
Jarkko Hietaniemi [Wed, 25 Jun 2014 19:44:49 +0000 (15:44 -0400)]
Follow-up to 51f14a05: not ignoring my_snprintf return values.

9 years agoGlossary for d_ptrdiff_t
Brian Fraser [Wed, 25 Jun 2014 13:30:37 +0000 (15:30 +0200)]
Glossary for d_ptrdiff_t

9 years agoAdd a small test case for c445c5b
Matthew Horsfall [Wed, 25 Jun 2014 14:31:20 +0000 (10:31 -0400)]
Add a small test case for c445c5b

9 years agoAdd t/porting/libperl.t
Jarkko Hietaniemi [Mon, 23 Jun 2014 18:11:50 +0000 (14:11 -0400)]
Add t/porting/libperl.t

For sanity checking libperl.a on those platforms that have one,
and extra checking for the rare configurations of -DPERL_GLOBAL_STRUCT
and -DPERL_GLOBAL_STRUCT_PRIVATE which restructure the symbol exports.

9 years agoRemove or downgrade unnecessary dVAR.
Jarkko Hietaniemi [Mon, 23 Jun 2014 11:01:34 +0000 (07:01 -0400)]
Remove or downgrade unnecessary dVAR.

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.

9 years agoUnused snprintf results noticed by clang in Linux.
Jarkko Hietaniemi [Tue, 24 Jun 2014 22:08:58 +0000 (18:08 -0400)]
Unused snprintf results noticed by clang in Linux.

A bit dubious to ignore the snprintf results, but at least
for these cases it looks acceptable.  We could assign the
length and croak if not expected, but it seems that with
gcc brace groups we already do that.

9 years agoFix RT #122171, lookahead issues with .*
Yves Orton [Wed, 25 Jun 2014 07:27:02 +0000 (09:27 +0200)]
Fix RT #122171, lookahead issues with .*

Patterns of the form /(?=.*X)X/ were getting the IMPLICIT flag set,
which does not work with lookahead.

This used to not be a problem as we did not look at the contents of
lookahead patterns in the start-class optimizer. In 07be1b83a6b2d24
I changed this, and this case would break. That it took this long
to come to light is probably because the pattern does not really make
sense.

https://rt.perl.org/Public/Bug/Display.html?id=122171

9 years agoperldelta for 0f9d28587772, cd293174fae5
Tony Cook [Wed, 25 Jun 2014 05:13:53 +0000 (15:13 +1000)]
perldelta for 0f9d28587772cd293174fae5

9 years agobump dist/Math-BigInt/ $VERSIONS to 1.9996
Tony Cook [Wed, 25 Jun 2014 04:53:50 +0000 (14:53 +1000)]
bump dist/Math-BigInt/ $VERSIONS to 1.9996

9 years agoCPAN RT 96254 and 96329: Correct the handling of subclasses.
Peter John Acklam [Sun, 15 Jun 2014 16:46:52 +0000 (18:46 +0200)]
CPAN RT 96254 and 96329: Correct the handling of subclasses.

Don't check for an exact class name; trust inheritance.

9 years agobump $XS::APItest::VERSION to 0.62
Matthew Horsfall (alh) [Wed, 25 Jun 2014 02:20:37 +0000 (22:20 -0400)]
bump $XS::APItest::VERSION to 0.62

9 years agoUnder GLOBAL_STRUCT mgvtbl-s are const, which angers g++.
Jarkko Hietaniemi [Tue, 24 Jun 2014 22:57:19 +0000 (18:57 -0400)]
Under GLOBAL_STRUCT mgvtbl-s are const, which angers g++.

See also 31114fe99.

9 years agoUnused contexts found under PERL_GLOBAL_STRUCT.
Jarkko Hietaniemi [Mon, 23 Jun 2014 11:01:34 +0000 (07:01 -0400)]
Unused contexts found under PERL_GLOBAL_STRUCT.

9 years agoDrop debugging, and handle HP-UX opt flags.
Jarkko Hietaniemi [Tue, 24 Jun 2014 14:28:05 +0000 (10:28 -0400)]
Drop debugging, and handle HP-UX opt flags.

9 years agoFurther hpux hints simplifying suggested by H.Merijn.
Jarkko Hietaniemi [Tue, 24 Jun 2014 13:12:48 +0000 (09:12 -0400)]
Further hpux hints simplifying suggested by H.Merijn.

9 years agoHP-UX release wider match; also drop gcc opt level.
Jarkko Hietaniemi [Tue, 24 Jun 2014 12:46:58 +0000 (08:46 -0400)]
HP-UX release wider match; also drop gcc opt level.

9 years agoRMG - Add comment that git clean -xdf after distclean should be no-op
Matthew Horsfall [Tue, 24 Jun 2014 12:11:37 +0000 (08:11 -0400)]
RMG - Add comment that git clean -xdf after distclean should be no-op

9 years agoDocument empty conditional in for/while
Peter Martini [Mon, 2 Jun 2014 11:16:59 +0000 (07:16 -0400)]
Document empty conditional in for/while

An empty conditional in both for and while has been treated
as true since perl 1.0.  This has a clear analogue in C/C++
in the case of for(;;), but while() is not legal C and should
be documented.

9 years agoremove extraneous setting of $TODO
Tony Cook [Tue, 24 Jun 2014 11:01:16 +0000 (21:01 +1000)]
remove extraneous setting of $TODO

dumper.t uses its own test framework, so it never did anything anyway.

9 years agofix multi-evals problems in pad name list api
Daniel Dragan [Wed, 11 Jun 2014 23:19:17 +0000 (19:19 -0400)]
fix multi-evals problems in pad name list api

The PAD_COMPNAME api, created in dd2155a49b , originally had alot of,
multi-eval problems, since av_fetch would be repeatedly called in macro
expansions. Later in commit b21dc0313d , an incomplete attempt at removing
multi-eval was done. Also in commit 035dab7448 added more multi-eval
problems. Prior to commit dd2155a49b , the code used a seemingly random
mix of av_fetch and AvARRAY, so both are ok. To fix this, replace av_fetch
with func-free AvARRAY. Since existing code has lval 0 to av_fetch and
unconditional deref on ret, a segv is fine to detect breakage.

A #define PAD_COMPNAME_SV(po) \
((assert(!SvMAGICAL(PL_comppad_name))),(AvARRAY(PL_comppad_name)[(po)]))
shows the AV is ! magical/tied during smoke. The assert was not added for
perf reasons on debugging builds. Inline funcs were not used for better
compiler optimizing if PAD_COMPNAME_FLAGS_isOUR is immediatly
followed by PAD_COMPNAME_OURSTASH (2 statements), as in scan_inputsymbol.
Inlines are not guaranteed to be inlined all the time on all compilers in all
situations, Visual C especially. Also inline is more likely to cause readding of
multi-eval problems than the macro if future changes to the API put the inline
func in a multi-eval macro.

On VC 2003 32bit .text section of perl521.dll dropped from 0xC296F to
0xC281F bytes of machine code with this patch.

9 years agoPERL_UNUSED_CONTEXT -> remove interp context where possible
Daniel Dragan [Sun, 15 Jun 2014 21:49:32 +0000 (17:49 -0400)]
PERL_UNUSED_CONTEXT -> remove interp context where possible

Removing context params will save machine code in the callers of these
functions, and 1 ptr of stack space. Some of these funcs are heavily used
as mg_find*. The contexts can always be readded in the future the same way
they were removed. This patch inspired by commit dc3bf40570. Also remove
PERL_UNUSED_CONTEXT when its not needed. See removal candidate rejection
rational in [perl #122106].

-Perl_hv_backreferences_p uses context in S_hv_auxinit
 commit 96a5add60f was wrong
-Perl_whichsig_sv and Perl_whichsig_pv wrongly used PERL_UNUSED_CONTEXT
 from inception in commit 84c7b88cca
-in authors opinion cast_* shouldn't be public API, no CPAN grep usage,
 can't be static and/or inline optimized since it is exported
-Perl_my_unexec move to block where it is needed, make Win32 block, context
 free, for inlining likelyhood, private api and only 2 callers in core
-Perl_my_dirfd make all blocks context free, then change proto
-Perl_bytes_cmp_utf8 wrongly used PERL_UNUSED_CONTEXT
 from inception in commit fed3ba5d6b

9 years ago[perl #116925] discuss modifying an SV's buffer
Tony Cook [Mon, 23 Jun 2014 23:55:39 +0000 (09:55 +1000)]
[perl #116925] discuss modifying an SV's buffer

9 years agoRMG - Per review - keep make distclean as a test, add comment
Matthew Horsfall [Mon, 23 Jun 2014 15:39:26 +0000 (11:39 -0400)]
RMG - Per review - keep make distclean as a test, add comment

9 years agoRMG - Per review - only -Dusedevel for development builds
Matthew Horsfall [Mon, 23 Jun 2014 15:37:34 +0000 (11:37 -0400)]
RMG - Per review - only -Dusedevel for development builds

9 years agoRMG - Clarify that updating %released/CAVEATS isn't for RCs
Matthew Horsfall [Mon, 23 Jun 2014 14:59:03 +0000 (10:59 -0400)]
RMG - Clarify that updating %released/CAVEATS isn't for RCs

9 years agoNo need for else after exit...
Matthew Horsfall [Mon, 23 Jun 2014 13:23:02 +0000 (09:23 -0400)]
No need for else after exit...

9 years agoDon't add a perldelta entry for _charnames.
Matthew Horsfall [Mon, 23 Jun 2014 12:59:59 +0000 (08:59 -0400)]
Don't add a perldelta entry for _charnames.

It's never been listed and it doesn't link properly, breaking
podcheck.t

9 years agoRMG: Show that version'd binaries might be used
Matthew Horsfall [Mon, 23 Jun 2014 12:41:09 +0000 (08:41 -0400)]
RMG: Show that version'd binaries might be used

9 years agoRMG: Use -Dusedevel in ./Configure, like everywhere else in the RMG.
Matthew Horsfall [Mon, 23 Jun 2014 12:40:08 +0000 (08:40 -0400)]
RMG: Use -Dusedevel in ./Configure, like everywhere else in the RMG.

9 years agoRMG: Remove useless 'make distclean', save time
Matthew Horsfall [Mon, 23 Jun 2014 12:37:31 +0000 (08:37 -0400)]
RMG: Remove useless 'make distclean', save time

9 years agoUpdate makerel to provide a helpful error message if chmod fails on @writables
Matthew Horsfall [Mon, 23 Jun 2014 12:31:47 +0000 (08:31 -0400)]
Update makerel to provide a helpful error message if chmod fails on @writables

9 years agoUpdate RMG to mention new policy of perlhist containing RMs names.
Matthew Horsfall [Mon, 23 Jun 2014 12:15:11 +0000 (08:15 -0400)]
Update RMG to mention new policy of perlhist containing RMs names.

9 years agoIf we do not have vsnprintf, the len is unused.
Jarkko Hietaniemi [Sat, 21 Jun 2014 12:05:08 +0000 (08:05 -0400)]
If we do not have vsnprintf, the len is unused.

9 years agoIn response to 7fefc6c, make autodoc smarter.
Matthew Horsfall [Sun, 22 Jun 2014 11:37:09 +0000 (07:37 -0400)]
In response to 7fefc6c, make autodoc smarter.

All non-blank lines after a =head1 are now skipped to find
header documentation. This unearthed a few more missed headings
that I think are useful, and makes sure others aren't missed in
the future.

Also, fix line number counting/error reporting in autodoc.pl, it
was woefully inaccurate.

9 years agoAllow enabling -pedantic(-errors) (with -std=c89) for the core.
Jarkko Hietaniemi [Fri, 20 Jun 2014 13:01:53 +0000 (09:01 -0400)]
Allow enabling -pedantic(-errors) (with -std=c89) for the core.

The core was already -pedantic clean (with default config, with
DEBUGGING almost), cflags just needed some juggling, somewhat
complicated by the logic of -Werror=declaration-after-statement.

Still requires -Dgccansipedantic to enable the -pedantic because
otherwise we do not use things like gcc brace groups and C99 variadic
macros, which are nice.  Also, see below about usedtrace complications.
(the gccansipedantic logic was odd, probably not used for a while.)

Under -DDEBUGGING the -pedantic requires quieting the warnings
about overlong string literals.

Disable -pedantic et al if usedtrace is enabled, it uses too many
non-standard features (and it depends on code generated by an external
framework).

9 years agog++ -DPERL_GLOBAL_STRUCT_PRIVATE died on this.
Jarkko Hietaniemi [Sun, 22 Jun 2014 02:52:43 +0000 (22:52 -0400)]
g++ -DPERL_GLOBAL_STRUCT_PRIVATE died on this.

9 years agoTry simpler usage for file-level GCC_DIAG_RESTORE.
Jarkko Hietaniemi [Fri, 20 Jun 2014 13:04:34 +0000 (09:04 -0400)]
Try simpler usage for file-level GCC_DIAG_RESTORE.

9 years agoIPC-Open3.t: For d3ae482b also need the "SKIP" label from the original.
George Greer [Sat, 21 Jun 2014 23:17:09 +0000 (19:17 -0400)]
IPC-Open3.t: For d3ae482b also need the "SKIP" label from the original.

9 years agoFix black Win32 smoke broken by my v5.21.1-11-g4077a6b (yet again)
Ævar Arnfjörð Bjarmason [Sat, 21 Jun 2014 21:13:43 +0000 (21:13 +0000)]
Fix black Win32 smoke broken by my v5.21.1-11-g4077a6b (yet again)

I was being silly with my test improvements in v5.21.1-12-g826af13 and
v5.21.1-13-g43d7f0d. I haven't been able to test this on Win32 where
it's breaking, but if the sprintf format isn't recognized there we're
going to get a warning about a *redundant* argument in printf, not a
missing one, i.e. just like this:

    $ ./perl -Ilib -we 'printf "%æ\n", "str"'
    Invalid conversion in printf: "%\303" at -e line 1.
    Redundant argument in printf at -e line 1.
    %s

So fix that, I'm certain this will fix the black smoke on Win32, if not
I have no idea what's going on.

9 years agoFix test file per George Greer comment.
James E Keenan [Sat, 21 Jun 2014 21:14:46 +0000 (23:14 +0200)]
Fix test file per George Greer comment.

9 years agolib/locale.t: Improve debug info
Karl Williamson [Sat, 21 Jun 2014 19:23:42 +0000 (13:23 -0600)]
lib/locale.t: Improve debug info

I find myself needing to get the percentage of locales failing when
looking at field reports with debugging on.  This commit adds that
information.

9 years agoMake like() and unlike() in t/test.pl refuse non-qr// arguments
Ævar Arnfjörð Bjarmason [Sat, 21 Jun 2014 17:44:20 +0000 (17:44 +0000)]
Make like() and unlike() in t/test.pl refuse non-qr// arguments

As I noted in v5.21.1-12-g826af13 we have subtle bugs in the test suite
because you can do e.g. like($@, '') now which'll be a passing test even
when we have an error, because $@ =~ // will be true.

I'm just changing t/test.pl to not accept non-Regexp arguments, and
fixing up a bunch of test failures that resulted from that. There might
still be more of these in tests that I'm just not running, I've also
changed some of these from $str =~ /foo/ to $str eq 'foo'
(i.e. s/like/is/) in cases where that appeared to work, but it might
break some systems.

Let's just find that out via the smokers.

9 years agoFix black Win32 smoke broken by my v5.21.1-11-g4077a6b (again)
Ævar Arnfjörð Bjarmason [Sat, 21 Jun 2014 17:57:40 +0000 (17:57 +0000)]
Fix black Win32 smoke broken by my v5.21.1-11-g4077a6b (again)

Fix a silly bug in v5.21.1-12-g826af13, when $Q was false I added 12
extra test, but didn't declare them, do that.

9 years agoFix black Win32 smoke broken by my v5.21.1-11-g4077a6b
Ævar Arnfjörð Bjarmason [Sat, 21 Jun 2014 16:23:29 +0000 (16:23 +0000)]
Fix black Win32 smoke broken by my v5.21.1-11-g4077a6b

The problem with this was that I didn't test this on a system where $Q
was false. On those systems we not only warn about "Invalid conversion"
but also about the missing sprintf argument, as intended.

The test broke because the local __WARN__ handler would clobber the
"conversion" warning with the "missing" warning, the fix is easy, just
accumulate the warnings with ".=".

While poking at this I discovered a bug that's been here ever since the
test was added back in v5.10.0-1461-g53f65a9. If we emitted a warning on
systems where $Q was true we'd pass the test, this is because the empty
regex will match warnings, the test actually meant to use is() not
like(). It's also a bug that t/test.pl accepts non-regexes as the second
argument, Test::More doesn't:

    $ perl -MTest::More -wle 'like "", ""'
    not ok 1
    #   Failed test at -e line 1.
    #     '' doesn't look much like a regex to me.
    # Tests were run but no plan was declared and done_testing() was not seen.

This change might cause some additional black smoke because we'll now be
detecting warnings that we previously ignored, but I don't think this'll
fail on systems where $Q is true.

9 years agoAdd a new warning about redundant printf arguments
Ævar Arnfjörð Bjarmason [Sun, 19 Jan 2014 16:27:58 +0000 (16:27 +0000)]
Add a new warning about redundant printf arguments

Implement RT #121025 and add a "redundant" warning category that
currently only warns about redundant arguments to printf. Now similarly
to how we already warned about missing printf arguments:

    $ ./miniperl -Ilib -we 'printf "%s\n", qw()'
    Missing argument in printf at -e line 1.

We'll now warn about redundant printf arguments:

    $ ./miniperl -Ilib -we 'printf "%s\n", qw(x y)'
    Redundant argument in printf at -e line 1.
    x

The motivation for this is that I recently fixed an insidious
long-standing 6 year old bug in a codebase I maintain that came down to
an issue that would have been detected by this warning.

Things to note about this patch:

 * It found a some long-standing redundant printf arguments in our own
   ExtUtils::MakeMaker code which I submitted fixes to in
   https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/84 and
   https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/pull/86,
   those fixes were merged into blead in v5.19.8-265-gb33b7ab

 * This warning correctly handles format parameter indexes (e.g. "%1$s")
   for some value of correctly. See the comment in t/op/sprintf2.t for
   an extensive discussion of how I've handled that.

 * We do the correct thing in my opinion when a pattern has redundant
   arguments *and* an invalid printf format. E.g. for the pattern "%A%s"
   with one argument we'll just warn about an invalid format as before,
   but with two arguments we'll warn about the invalid format *and* the
   redundant argument.

   This helps to disambiguate cases where the user just meant to write a
   literal "%SOMETHING" v.s. cases where he though "%S" might be a valid
   printf format.

 * I originally wrote this while the 5.19 series was under way, but Dave
   Mitchell has noted that a warning like this should go into blead
   after 5.20 is released:

       "[...] I think it should go into blead just after 5.20 is
       released, rather than now; I think it'd going to kick up a lot of
       dust and we'll want to give CPAN module owners maximum lead time
       to fix up their code. For example, if its generating warnings in
       cpan/ code in blead, then we need those module authors to fix
       their code, produce stable new releases, pull them back into
       blead, and let them bed in before we start pushing out 5.20 RC
       candidates"

   I agree, but we could have our cake and eat it too if "use warnings"
   didn't turn this on but an explicit "use warnings qw(redundant)" did.
   Then in 5.22 we could make "use warnings" also import the "redundant"
   category, and in the meantime you could turn this on
   explicitly.

   There isn't an existing feature for adding that kind of warning in
   the core. And my attempts at doing so failed, see commentary in RT
   #121025.

The warning needed to be added to a few places in sv.c because the "",
"%s" and "%-p" patterns all bypass the normal printf handling for
optimization purposes. The new warning works correctly on all of
them. See the tests in t/op/sprintf2.t.

It's worth mentioning that both Debian Clang 3.3-16 and GCC 4.8.2-12
warn about this in C code under -Wall:

    $ cat redundant.c
    #include <stdio.h>

    int main(void) {
        printf("%d\n", 123, 345);
        return 0;
    }
    $ clang -Wall -o redundant redundant.c
    redundant.c:4:25: warning: data argument not used by format string [-Wformat-extra-args]
        printf("%d\n", 123, 345);
               ~~~~~~       ^
    1 warning generated.
    $ gcc -Wall -o redundant redundant.c
    redundant.c: In function ‘main’:
    redundant.c:4:5: warning: too many arguments for format [-Wformat-extra-args]
         printf("%d\n", 123, 345);
         ^

So I'm not the first person to think that this might be generally
useful.

There are also other internal functions that could benefit from
missing/redundant warnings, e.g. pack. Neither of these things currently
warn, but should:

    $ perl -wE 'say pack "AA", qw(x y z)'
    xy
    $ perl -wE 'say pack "AAAA", qw(x y z)'
    xyz

I'll file a bug for that, and might take a stab at implementing it.

9 years agoSplit up the fake "missing" warning category into an actual category
Ævar Arnfjörð Bjarmason [Sun, 19 Jan 2014 14:58:02 +0000 (14:58 +0000)]
Split up the fake "missing" warning category into an actual category

Ever since the warning for missing printf arguments was added in
v5.11.2-116-g7baa469 the "missing" warning category has been defined in
terms of the "uninitialized" category, so you couldn't turn it on/off
independently of that.

As discussed in RT #121025 I'm hacking on adding a new "reduntant"
category for too many printf arguments. So add the long-missing
"missing" category in preparation for that for consistency.

9 years agoRevert 6 tests failing on Win32 smoker.
James E Keenan [Sat, 21 Jun 2014 13:04:12 +0000 (09:04 -0400)]
Revert 6 tests failing on Win32 smoker.

9 years agoUntie STDERR in IPC::Open3.
Dmitri Tikhonov [Sat, 7 Jun 2014 04:23:50 +0000 (00:23 -0400)]
Untie STDERR in IPC::Open3.

Add Dmitri Tikhonov to Perl 5 AUTHORS.
Increment IPC/Open3.pm $VERSION.

For: RT #119843, originally reported by A.N.

9 years agoFix typo... nothing to see here
Matthew Horsfall (alh) [Fri, 20 Jun 2014 18:59:01 +0000 (14:59 -0400)]
Fix typo... nothing to see here

9 years agoCorrect unintentional mistake in bump-perl-version
Chris 'BinGOs' Williams [Fri, 20 Jun 2014 18:35:25 +0000 (19:35 +0100)]
Correct unintentional mistake in bump-perl-version

9 years agoperlfunc: clarify our [perl #122132]
David Golden [Fri, 20 Jun 2014 14:16:27 +0000 (10:16 -0400)]
perlfunc: clarify our [perl #122132]

9 years agoUpdate Module::CoreList for 5.21.2
Matthew Horsfall (alh) [Fri, 20 Jun 2014 17:15:06 +0000 (13:15 -0400)]
Update Module::CoreList for 5.21.2

9 years agoBump the perl version in various places for 5.21.2
Matthew Horsfall (alh) [Fri, 20 Jun 2014 17:04:41 +0000 (13:04 -0400)]
Bump the perl version in various places for 5.21.2

9 years agoAdd Epipgraph for 5.21.1
Matthew Horsfall (alh) [Fri, 20 Jun 2014 17:03:30 +0000 (13:03 -0400)]
Add Epipgraph for 5.21.1

9 years agoAdd new perldelta for 5.21.2
Matthew Horsfall (alh) [Fri, 20 Jun 2014 16:09:57 +0000 (12:09 -0400)]
Add new perldelta for 5.21.2

9 years agoAdd new release to perlhist v5.21.1
Matthew Horsfall (alh) [Fri, 20 Jun 2014 12:21:52 +0000 (08:21 -0400)]
Add new release to perlhist

9 years agoFinalize perldelta
Matthew Horsfall (alh) [Fri, 20 Jun 2014 12:18:59 +0000 (08:18 -0400)]
Finalize perldelta

9 years agoUpdate Module::CoreList for 5.21.1
Matthew Horsfall (alh) [Fri, 20 Jun 2014 11:52:56 +0000 (07:52 -0400)]
Update Module::CoreList for 5.21.1

9 years agoUpdate perldelta acknowledgements
Matthew Horsfall (alh) [Fri, 20 Jun 2014 11:32:28 +0000 (07:32 -0400)]
Update perldelta acknowledgements

9 years agoBegin to finalize perldelta for release
Matthew Horsfall (alh) [Fri, 20 Jun 2014 11:29:07 +0000 (07:29 -0400)]
Begin to finalize perldelta for release

9 years agoGCC_DIAG_IGNORE/RESTORE whine in non-gcc if at file level.
Jarkko Hietaniemi [Fri, 20 Jun 2014 02:03:25 +0000 (22:03 -0400)]
GCC_DIAG_IGNORE/RESTORE whine in non-gcc if at file level.

9 years agoCouple more (optionally) unused contexts.
Jarkko Hietaniemi [Thu, 19 Jun 2014 18:40:36 +0000 (14:40 -0400)]
Couple more (optionally) unused contexts.

9 years agoAvoid blank lines in backslash warnings test.
Craig A. Berry [Thu, 19 Jun 2014 23:29:35 +0000 (18:29 -0500)]
Avoid blank lines in backslash warnings test.

This is a follow-up to 12f55bbce575aecc, which fell victim to a
bug workaround. Because the broken pipes on VMS sometimes put
multiple blank lines in test output, we collapse multiple newlines
into one.  Which breaks tests that genuinely have multiple blank
lines in the output.

So don't leave the output blank, which coincidentally makes it a
lot easier to see which print statement produces which line of
output.

9 years agofix a typo in perl520delta
Ricardo Signes [Thu, 19 Jun 2014 23:22:27 +0000 (19:22 -0400)]
fix a typo in perl520delta

9 years agoRemove x2p remnants
Matthew Horsfall (alh) [Thu, 19 Jun 2014 23:19:44 +0000 (19:19 -0400)]
Remove x2p remnants

9 years agoRemove old file from @writables; was taken out in autodie 2.24
Matthew Horsfall (alh) [Thu, 19 Jun 2014 22:54:57 +0000 (18:54 -0400)]
Remove old file from @writables; was taken out in autodie 2.24

9 years agoIn case someone manages to call g++ with -Wc++-compat.
Jarkko Hietaniemi [Thu, 19 Jun 2014 21:55:34 +0000 (17:55 -0400)]
In case someone manages to call g++ with -Wc++-compat.

9 years agoNote the open RT ticket.
Jarkko Hietaniemi [Thu, 19 Jun 2014 19:08:25 +0000 (15:08 -0400)]
Note the open RT ticket.

9 years agoDisable ODBM (via i_dbm) in HP-UX, seems to be buggy.
Jarkko Hietaniemi [Thu, 19 Jun 2014 16:07:26 +0000 (12:07 -0400)]
Disable ODBM (via i_dbm) in HP-UX, seems to be buggy.

9 years agoLower the optimization on Digest-SHA for HP-UX cc.
Jarkko Hietaniemi [Thu, 19 Jun 2014 15:33:32 +0000 (11:33 -0400)]
Lower the optimization on Digest-SHA for HP-UX cc.

Upstream, but we are adding a platform specific hints file.

9 years agoHP-UX cc in PA-RISC2.0 optimizer crashes with some files.
Jarkko Hietaniemi [Thu, 19 Jun 2014 15:13:00 +0000 (11:13 -0400)]
HP-UX cc in PA-RISC2.0 optimizer crashes with some files.

9 years agoThe g++ flags removal was not right.
Jarkko Hietaniemi [Thu, 19 Jun 2014 13:44:59 +0000 (09:44 -0400)]
The g++ flags removal was not right.

9 years agoSilence -Wunused-parameter my_perl under threads.
Jarkko Hietaniemi [Wed, 18 Jun 2014 22:56:45 +0000 (18:56 -0400)]
Silence -Wunused-parameter my_perl under threads.

For S_ functions, remove the context.
For Perl_ functions, add PERL_UNUSED_CONTEXT.

Tricky because sometimes depends on DEBUGGING, and sometimes
on whether we are have PERL_IMPLICIT_SYS.

(Why all the mathoms Perl_is_uni_... and Perl_is_utf8_...
functions are not being whined about is a mystery.)

vutil.c (included via util.c) has one of these, but it's cpan/,
and a known problem: https://rt.cpan.org/Ticket/Display.html?id=96100

9 years agoRevert "/* NOTREACHED */ belongs *before* the unreachable."
Jarkko Hietaniemi [Thu, 19 Jun 2014 15:19:54 +0000 (11:19 -0400)]
Revert "/* NOTREACHED */ belongs *before* the unreachable."

This reverts commit 148f39b7de6eae9ddd59e0b0aff691d6abea7aca.

(Still needs more work, but wanted to see how well this passed with Jenkins.)

9 years ago/* NOTREACHED */ belongs *before* the unreachable.
Jarkko Hietaniemi [Thu, 19 Jun 2014 10:43:08 +0000 (06:43 -0400)]
/* NOTREACHED */ belongs *before* the unreachable.

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.

9 years agoRevert the perl.h part of a3ccabc.
Jarkko Hietaniemi [Wed, 18 Jun 2014 21:53:48 +0000 (17:53 -0400)]
Revert the perl.h part of a3ccabc.

(Worked in smokes, bombed under Jenkins.)

9 years agoGCC_DIAG_IGNORE needs to end with semicolon (inline.h).
Jarkko Hietaniemi [Wed, 18 Jun 2014 19:36:17 +0000 (15:36 -0400)]
GCC_DIAG_IGNORE needs to end with semicolon (inline.h).

Furthermore, make the GCC_DIAG_IGNORE and _RESTORE to be dNOOPs,
so that they can be at any level of the code, including global, even
when the compiler is not gcc (or lookalike).  If they are just empty,
";" will be left at the call site.

9 years agoRegenerate podcheck.t db for new too-long verbatim lines
Karl Williamson [Wed, 18 Jun 2014 19:33:59 +0000 (13:33 -0600)]
Regenerate podcheck.t db for new too-long verbatim lines

9 years agoPATCH: [perl #122126] BBC DBD::SQLite
Karl Williamson [Wed, 18 Jun 2014 19:01:41 +0000 (13:01 -0600)]
PATCH: [perl #122126] BBC DBD::SQLite

This problem turns out to be a misspelling in two places of a compiler
definition.  Since the definition didn't exist (as it was misspelled),
the #ifdef failed.

I don't know how really to test this as it is locale collation, which
varies by locale, and we would be relying on vendor-supplied locales
which may be inconsistent between platforms.  I intend to tackle
improvements to collaction later this release cycle, and should come up
with tests at that time.  The failing tests in the module were comparing
the Perl sort results with those of the module, and finding they differ.

9 years agoAdd a note about the HP-UX "internal linkage" warning.
Jarkko Hietaniemi [Wed, 18 Jun 2014 18:58:03 +0000 (14:58 -0400)]
Add a note about the HP-UX "internal linkage" warning.

9 years agoTry silencing the infamous PerlSIO_set_ptr in perlio.c.
Jarkko Hietaniemi [Wed, 18 Jun 2014 15:10:22 +0000 (11:10 -0400)]
Try silencing the infamous PerlSIO_set_ptr in perlio.c.

9 years ago__clang__ seems to be thing, but leave also __clang.
Jarkko Hietaniemi [Wed, 18 Jun 2014 15:09:05 +0000 (11:09 -0400)]
__clang__ seems to be thing, but leave also __clang.

This fixes the GCC_DIAG_IGNORE() + GCC_DIAG_RESTORE with clang.

9 years agoAdd note about the -std=c89 needing -pedantic.
Jarkko Hietaniemi [Wed, 18 Jun 2014 15:49:40 +0000 (11:49 -0400)]
Add note about the -std=c89 needing -pedantic.

9 years agoEcho also these added options.
Jarkko Hietaniemi [Wed, 18 Jun 2014 13:20:18 +0000 (09:20 -0400)]
Echo also these added options.

9 years ago-Wextra is the new -W, do not use both.
Jarkko Hietaniemi [Wed, 18 Jun 2014 13:12:18 +0000 (09:12 -0400)]
-Wextra is the new -W, do not use both.

9 years ago-Wendif-labels is actually the default.
Jarkko Hietaniemi [Wed, 18 Jun 2014 13:06:26 +0000 (09:06 -0400)]
-Wendif-labels is actually the default.

Has been AFAICT for years / always, the documentation just
had it wrong in pre-4.0 gccs.

9 years agoEnable -Werror=declaration-after-statement.
Jarkko Hietaniemi [Wed, 18 Jun 2014 13:04:24 +0000 (09:04 -0400)]
Enable -Werror=declaration-after-statement.

For C89 compliancy, this is the most common thinko people make.
While waiting for -pedantic -std=c89, which will catch the same.

9 years agoComment tweaking.
Jarkko Hietaniemi [Wed, 18 Jun 2014 12:44:52 +0000 (08:44 -0400)]
Comment tweaking.

9 years agoMake also cflags.SH clean with g++ -Wunused-*
Jarkko Hietaniemi [Wed, 18 Jun 2014 12:43:37 +0000 (08:43 -0400)]
Make also cflags.SH clean with g++ -Wunused-*

"clean" as in "not needed anymore".

9 years agoWith this we are g++ -Wunused-* clean.
Jarkko Hietaniemi [Wed, 18 Jun 2014 12:52:17 +0000 (08:52 -0400)]
With this we are g++ -Wunused-* clean.

9 years agoLooks like the core is now -Wunused-value clean with clang.
Jarkko Hietaniemi [Wed, 18 Jun 2014 12:27:54 +0000 (08:27 -0400)]
Looks like the core is now -Wunused-value clean with clang.

Another possibility is that clang has become smarter,
and that needs to be made dependent on clang version.
But for now, let's opt for simplicity and less logic.

9 years agoAvoid missing return warning in pp_die.
Craig A. Berry [Wed, 18 Jun 2014 16:40:28 +0000 (11:40 -0500)]
Avoid missing return warning in pp_die.

Even though it can't be reached, the absence of a return statement
makes the VMS C compiler warn that it's missing.