develooper Front page | perl.perl5.porters | Postings from August 2013

Re: [perl #119497] Bleadperl v5.19.3-111-g25fdce4 breaksDANIEL/Crypt-OpenSSL-X509-1.803.tar.gz

Thread Previous
From:
Nicholas Clark
Date:
August 28, 2013 08:54
Subject:
Re: [perl #119497] Bleadperl v5.19.3-111-g25fdce4 breaksDANIEL/Crypt-OpenSSL-X509-1.803.tar.gz
Message ID:
20130828085407.GK66035@plum.flirble.org
On Wed, Aug 28, 2013 at 12:17:08AM -0700, Andreas J. Koenig via RT wrote:

> cc -c  -I/usr/include/openssl -I/usr/local/include/ssl -I/usr/local/ssl/include -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -Wall -Werror   -DVERSION=\"1.803\" -DXS_VERSION=\"1.803\" -fPIC "-I/home/sand/src/perl/repoperls/installed-perls/perl/v5.19.3-111-g25fdce4/9980/lib/5.19.4/x86_64-linux-thread-multi/CORE"   X509.c                     
> In file included from /home/sand/src/perl/repoperls/installed-perls/perl/v5.19.3-111-g25fdce4/9980/lib/5.19.4/x86_64-linux-thread-multi/CORE/perl.h:4959:0,
>                  from X509.xs:2:
> /home/sand/src/perl/repoperls/installed-perls/perl/v5.19.3-111-g25fdce4/9980/lib/5.19.4/x86_64-linux-thread-multi/CORE/proto.h:4162:26: error: 'S_sv_or_pv_pos_u2b' declared 'static' but never defined [-Werror=unused-function]           
>  PERL_STATIC_INLINE STRLEN S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp)
>                           ^     
> cc1: all warnings being treated as errors
> make: *** [X509.o] Error 1      

That's brave, treating all warnings as errors, when you don't control all
the headers you use. Or the future versions of the compiler.

Anyway, we shouldn't be causing that warning. Will be fixed by the appended
commit. I'm going to mark this as resolved.

Nicholas Clark


commit c47d1a661f01f02ad5b41aa6275b11a9bd5a1dd2
Author: Nicholas Clark <nick@ccl4.org>
Date:   Wed Aug 28 10:47:42 2013 +0200

    Only predeclare S_sv_or_pv_pos_u2b for -DPERL_CORE or -DPERL_EXT
    
    Otherwise when compiling XS code, there is a declaration for a function
    which is never used, which can cause some compilers to issue a warning.

diff --git a/embed.fnc b/embed.fnc
index 559be3e..bebed86 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -2670,7 +2670,9 @@ Xop	|bool	|feature_is_enabled|NN const char *const name \
 
 : Some static inline functions need predeclaration because they are used
 : inside other static inline functions.
+#if defined(PERL_CORE) || defined (PERL_EXT)
 Ei	|STRLEN	|sv_or_pv_pos_u2b|NN SV *sv|NN const char *pv|STRLEN pos \
 				 |NULLOK STRLEN *lenp
+#endif
 
 : ex: set ts=8 sts=4 sw=4 noet:
diff --git a/embed.h b/embed.h
index 8874b68..1329937 100644
--- a/embed.h
+++ b/embed.h
@@ -873,7 +873,6 @@
 #define regprop(a,b,c)		Perl_regprop(aTHX_ a,b,c)
 #define report_uninit(a)	Perl_report_uninit(aTHX_ a)
 #define sv_magicext_mglob(a)	Perl_sv_magicext_mglob(aTHX_ a)
-#define sv_or_pv_pos_u2b(a,b,c,d)	S_sv_or_pv_pos_u2b(aTHX_ a,b,c,d)
 #define validate_proto(a,b,c)	Perl_validate_proto(aTHX_ a,b,c)
 #define vivify_defelem(a)	Perl_vivify_defelem(aTHX_ a)
 #define yylex()			Perl_yylex(aTHX)
@@ -897,6 +896,9 @@
 #  if defined(PERL_ANY_COW)
 #define sv_setsv_cow(a,b)	Perl_sv_setsv_cow(aTHX_ a,b)
 #  endif
+#  if defined(PERL_CORE) || defined (PERL_EXT)
+#define sv_or_pv_pos_u2b(a,b,c,d)	S_sv_or_pv_pos_u2b(aTHX_ a,b,c,d)
+#  endif
 #  if defined(PERL_IN_REGCOMP_C)
 #define _append_range_to_invlist(a,b,c)	S__append_range_to_invlist(aTHX_ a,b,c)
 #define _invlist_array_init(a,b)	S__invlist_array_init(aTHX_ a,b)
diff --git a/proto.h b/proto.h
index 5b3a98f..30fcba5 100644
--- a/proto.h
+++ b/proto.h
@@ -4167,12 +4167,6 @@ PERL_CALLCONV NV	Perl_sv_nv(pTHX_ SV* sv)
 #define PERL_ARGS_ASSERT_SV_NV	\
 	assert(sv)
 
-PERL_STATIC_INLINE STRLEN	S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp)
-			__attribute__nonnull__(pTHX_1)
-			__attribute__nonnull__(pTHX_2);
-#define PERL_ARGS_ASSERT_SV_OR_PV_POS_U2B	\
-	assert(sv); assert(pv)
-
 PERL_CALLCONV char*	Perl_sv_peek(pTHX_ SV* sv);
 PERL_CALLCONV void	Perl_sv_pos_b2u(pTHX_ SV *const sv, I32 *const offsetp)
 			__attribute__nonnull__(pTHX_2);
@@ -5443,6 +5437,14 @@ PERL_CALLCONV void	Perl_Slab_to_rw(pTHX_ OPSLAB *const slab)
 
 #  endif
 #endif
+#if defined(PERL_CORE) || defined (PERL_EXT)
+PERL_STATIC_INLINE STRLEN	S_sv_or_pv_pos_u2b(pTHX_ SV *sv, const char *pv, STRLEN pos, STRLEN *lenp)
+			__attribute__nonnull__(pTHX_1)
+			__attribute__nonnull__(pTHX_2);
+#define PERL_ARGS_ASSERT_SV_OR_PV_POS_U2B	\
+	assert(sv); assert(pv)
+
+#endif
 #if defined(PERL_CR_FILTER)
 #  if defined(PERL_IN_TOKE_C)
 STATIC I32	S_cr_textfilter(pTHX_ int idx, SV *sv, int maxlen);

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About