summaryrefslogtreecommitdiff
path: root/mg.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2016-11-17 06:21:54 -0700
committerKarl Williamson <khw@cpan.org>2016-11-18 09:41:07 -0700
commit147e38468b8279e26a0ca11e4efd8492016f2702 (patch)
tree4d3c3b5b692937fc40e2fed20aaa1b7afd3ba56e /mg.c
parent51d89e3583b4182c42c21b343376f2286f67fc3b (diff)
downloadperl-147e38468b8279e26a0ca11e4efd8492016f2702.tar.gz
Change white space to avoid C++ deprecation warning
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.
Diffstat (limited to 'mg.c')
-rw-r--r--mg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mg.c b/mg.c
index d0d3b9dc7e..b7ce69d634 100644
--- a/mg.c
+++ b/mg.c
@@ -1127,7 +1127,7 @@ Perl_magic_get(pTHX_ SV *sv, MAGIC *mg)
Newx(gary, num_groups, Groups_t);
num_groups = getgroups(num_groups, gary);
for (i = 0; i < num_groups; i++)
- Perl_sv_catpvf(aTHX_ sv, " %"IVdf, (IV)gary[i]);
+ Perl_sv_catpvf(aTHX_ sv, " %" IVdf, (IV)gary[i]);
Safefree(gary);
}
}
@@ -2002,7 +2002,7 @@ Perl_magic_setdbline(pTHX_ SV *sv, MAGIC *mg)
/* The magic ptr/len for the debugger's hash should always be an SV. */
if (UNLIKELY(mg->mg_len != HEf_SVKEY)) {
- Perl_croak(aTHX_ "panic: magic_setdbline len=%"IVdf", ptr='%s'",
+ Perl_croak(aTHX_ "panic: magic_setdbline len=%" IVdf ", ptr='%s'",
(IV)mg->mg_len, mg->mg_ptr);
}
@@ -3246,7 +3246,7 @@ Perl_sighandler(int sig)
: cv && CvGV(cv) ? GvENAME_HEK(CvGV(cv)) : NULL;
if (hek)
Perl_ck_warner(aTHX_ packWARN(WARN_SIGNAL),
- "SIG%s handler \"%"HEKf"\" not defined.\n",
+ "SIG%s handler \"%" HEKf "\" not defined.\n",
PL_sig_name[sig], HEKfARG(hek));
/* diag_listed_as: SIG%s handler "%s" not defined */
else Perl_ck_warner(aTHX_ packWARN(WARN_SIGNAL),