summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorDaniel Dragan <bulk88@hotmail.com>2014-11-15 21:00:16 -0500
committerFather Chrysostomos <sprout@cpan.org>2014-11-15 22:17:42 -0800
commitf8d5a52263698f3448751c5ac18d2b5edac28b36 (patch)
tree19b0723c7099256a9d5e6591d9100c4739fc131f /util.c
parentc1f06047c0ded9ef04cacab9735c6c65fa803b18 (diff)
downloadperl-f8d5a52263698f3448751c5ac18d2b5edac28b36.tar.gz
readd noreturn and silence "noreturn that returns" warning on MSVC
Based on commit 73758d77 (by me), in commit 117af67d629 more things got noreturn removed on MSVC. See also ML post "(Hugmeir) Re: [perl.git] branch blead, updated. v5.21.0-377-gdc3bf40" This caused a measurable increase in machine code size in 117af67d629 . In commit 73758d77 , the reason there was no increase is Perl_magic_regdatum_set is called only through a magic vtable. Optimizing this to noreturn is forbidden unless the struct member type specifies it (and it obviously doesn't, since this is the magic vtable). The other not-noreturn on MSVC function, Perl_screaminstr, has no core usage (its only reference is in the export table) or CPAN grep usage so therefore it is being removed. It was made fatal in commit 9e3f0d16db . before .text section of perl521.dll on VC 2003 32b, 0xc66a3 bytes, after 0xc6453
Diffstat (limited to 'util.c')
-rw-r--r--util.c47
1 files changed, 30 insertions, 17 deletions
diff --git a/util.c b/util.c
index 49faf9bb13..35ab0876bb 100644
--- a/util.c
+++ b/util.c
@@ -917,23 +917,6 @@ Perl_fbm_instr(pTHX_ unsigned char *big, unsigned char *bigend, SV *littlestr, U
}
}
-char *
-Perl_screaminstr(pTHX_ SV *bigstr, SV *littlestr, I32 start_shift, I32 end_shift, I32 *old_posp, I32 last)
-{
- PERL_ARGS_ASSERT_SCREAMINSTR;
- PERL_UNUSED_ARG(bigstr);
- PERL_UNUSED_ARG(littlestr);
- PERL_UNUSED_ARG(start_shift);
- PERL_UNUSED_ARG(end_shift);
- PERL_UNUSED_ARG(old_posp);
- PERL_UNUSED_ARG(last);
-
- /* This function must only ever be called on a scalar with study magic,
- but those do not happen any more. */
- Perl_croak(aTHX_ "panic: screaminstr");
- NORETURN_FUNCTION_END;
-}
-
/*
=for apidoc foldEQ
@@ -1565,6 +1548,13 @@ The function never actually returns.
=cut
*/
+#ifdef _MSC_VER
+# pragma warning( push )
+# pragma warning( disable : 4646 ) /* warning C4646: function declared with
+ __declspec(noreturn) has non-void return type */
+# pragma warning( disable : 4645 ) /* warning C4645: function declared with
+__declspec(noreturn) has a return statement */
+#endif
OP *
Perl_die_sv(pTHX_ SV *baseex)
{
@@ -1573,6 +1563,9 @@ Perl_die_sv(pTHX_ SV *baseex)
assert(0); /* NOTREACHED */
NORETURN_FUNCTION_END;
}
+#ifdef _MSC_VER
+# pragma warning( pop )
+#endif
/*
=for apidoc Am|OP *|die|const char *pat|...
@@ -1585,6 +1578,13 @@ The function never actually returns.
*/
#if defined(PERL_IMPLICIT_CONTEXT)
+#ifdef _MSC_VER
+# pragma warning( push )
+# pragma warning( disable : 4646 ) /* warning C4646: function declared with
+ __declspec(noreturn) has non-void return type */
+# pragma warning( disable : 4645 ) /* warning C4645: function declared with
+__declspec(noreturn) has a return statement */
+#endif
OP *
Perl_die_nocontext(const char* pat, ...)
{
@@ -1596,8 +1596,18 @@ Perl_die_nocontext(const char* pat, ...)
va_end(args);
NORETURN_FUNCTION_END;
}
+#ifdef _MSC_VER
+# pragma warning( pop )
+#endif
#endif /* PERL_IMPLICIT_CONTEXT */
+#ifdef _MSC_VER
+# pragma warning( push )
+# pragma warning( disable : 4646 ) /* warning C4646: function declared with
+ __declspec(noreturn) has non-void return type */
+# pragma warning( disable : 4645 ) /* warning C4645: function declared with
+__declspec(noreturn) has a return statement */
+#endif
OP *
Perl_die(pTHX_ const char* pat, ...)
{
@@ -1608,6 +1618,9 @@ Perl_die(pTHX_ const char* pat, ...)
va_end(args);
NORETURN_FUNCTION_END;
}
+#ifdef _MSC_VER
+# pragma warning( pop )
+#endif
/*
=for apidoc Am|void|croak_sv|SV *baseex