This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
embed.fnc: swash_init() return value should not be ignored
authorKarl Williamson <public@khwilliamson.com>
Sun, 20 Nov 2011 16:03:26 +0000 (09:03 -0700)
committerKarl Williamson <public@khwilliamson.com>
Fri, 13 Jan 2012 16:58:33 +0000 (09:58 -0700)
Otherwise can have memory leaks

embed.fnc
proto.h

index 9f7183a..c587946 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1354,7 +1354,7 @@ Apd       |void   |sv_vsetpvfn    |NN SV *const sv|NN const char *const pat|const STRLEN pa
                                |NULLOK va_list *const args|NULLOK SV **const svargs \
                                |const I32 svmax|NULLOK bool *const maybe_tainted
 ApR    |NV     |str_to_version |NN SV *sv
-Ap     |SV*    |swash_init     |NN const char* pkg|NN const char* name|NN SV* listsv|I32 minbits|I32 none
+ApR    |SV*    |swash_init     |NN const char* pkg|NN const char* name|NN SV* listsv|I32 minbits|I32 none
 Ap     |UV     |swash_fetch    |NN SV *swash|NN const U8 *ptr|bool do_utf8
 #ifdef PERL_IN_REGCOMP_C
 EiMR   |SV*    |add_cp_to_invlist      |NULLOK SV* invlist|const UV cp
diff --git a/proto.h b/proto.h
index a6a1a44..e0939eb 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -4387,6 +4387,7 @@ PERL_CALLCONV UV  Perl_swash_fetch(pTHX_ SV *swash, const U8 *ptr, bool do_utf8)
        assert(swash); assert(ptr)
 
 PERL_CALLCONV SV*      Perl_swash_init(pTHX_ const char* pkg, const char* name, SV* listsv, I32 minbits, I32 none)
+                       __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_3);