S_pad_findlex has side effects, so its return value may be ignored
Dave Mitchell [Tue, 12 Jul 2005 18:29:43 +0000 (18:29 +0000)]
p4raw-id: //depot/perl@25127

embed.fnc
pad.c
proto.h

index 0532cf5..527d8e4 100644 (file)
--- a/embed.fnc
+++ b/embed.fnc
@@ -1405,7 +1405,7 @@ pd        |void   |pad_push       |NN PADLIST *padlist|int depth
 pR     |HV*    |pad_compname_type|const PADOFFSET po
 
 #if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
-sdR    |PADOFFSET|pad_findlex  |NN const char *name|NN const CV* cv|U32 seq|int warn \
+sd     |PADOFFSET|pad_findlex  |NN const char *name|NN const CV* cv|U32 seq|int warn \
                                |NULLOK SV** out_capture|NN SV** out_name_sv \
                                |NN int *out_flags
 #  if defined(DEBUGGING)
diff --git a/pad.c b/pad.c
index 9ebe266..5f04fd6 100644 (file)
--- a/pad.c
+++ b/pad.c
@@ -753,7 +753,8 @@ S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn,
                            "Pad findlex cv=0x%"UVxf" chasing lex in outer pad\n",
                            PTR2UV(cv)));
                        n = *out_name_sv;
-                       pad_findlex(name, CvOUTSIDE(cv), CvOUTSIDE_SEQ(cv),
+                       (void) pad_findlex(name, CvOUTSIDE(cv),
+                           CvOUTSIDE_SEQ(cv),
                            newwarn, out_capture, out_name_sv, out_flags);
                        *out_name_sv = n;
                        return offset;
diff --git a/proto.h b/proto.h
index 39e5a2d..0dc9b03 100644 (file)
--- a/proto.h
+++ b/proto.h
@@ -3018,7 +3018,6 @@ PERL_CALLCONV HV* Perl_pad_compname_type(pTHX_ const PADOFFSET po)
 
 #if defined(PERL_IN_PAD_C) || defined(PERL_DECL_PROT)
 STATIC PADOFFSET       S_pad_findlex(pTHX_ const char *name, const CV* cv, U32 seq, int warn, SV** out_capture, SV** out_name_sv, int *out_flags)
-                       __attribute__warn_unused_result__
                        __attribute__nonnull__(pTHX_1)
                        __attribute__nonnull__(pTHX_2)
                        __attribute__nonnull__(pTHX_6)