Re: DBD::Oracle fails to compile on Fedora 41

[email protected] (Daniël van Eeden) Mon, 25 Nov 2024 07:17:09 +0100
Newsgroups perl.dbi.dev
Message-ID <[email protected]>
--=_f0b12e9c81bc939bdcde832a838dd27d
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8;
 format=flowed



Hi,

The deprecation warning might be related to 
https://github.com/perl5-dbi/dbi/pull/112 / 
https://github.com/perl5-dbi/dbi/issues/110

Daniël van Eeden

On 2024-11-24 14:29, Henrique Martins wrote:

> Upgraded to Fedora 41, new compiler that comes with it seems to have 
> -Wreturn-mismatch enabled.
> 
> When trying to install DBD::Oracle with cpan, I get this error:
> dbdcnx.c:90:25: error: 'return' with no value, in function returning 
> non-void [-Wreturn-mismatch]
> 90 |     if(llist_empty(el)) return;\
> 
> Looking at dbdcnx, the llist_drop(ael) macro does contain the return 
> line above.
> 
> The macro is used in functions
> 
> release_env, which returns a void
> find_env, which returns a env_box_t*
> release_pool, which returns a void
> 
> and the call within find_env needs a "return NULL;" instead.
> 
> I was able to make it compile with two (silly) methods
> 
> - duplicated the macro with
> return NULL
> instead of
> return
> called it from find_env
> 
> - added argument to the macro
> llist_drop(ael, ret)
> called it as
> llist_drop(&box->base.lock, return);
> or
> llist_drop(&box->base.lock, return NULL);
> where appropriate.
> 
> Both approaches compile, have the first one in place, will try the 
> second later.
> 
> -- Henrique
> 
> -----------------------------------------------------------------
> 
> I also get a deprecation warning as below, didn't look at it
> 
> Oracle.xs: In function 'XS_DBD__Oracle__st_ora_fetch':
> Oracle.xs:233:9: warning: 'Perl_dowantarray' is deprecated 
> [-Wdeprecated-declarations]
> 233 |         if (GIMME == G_SCALAR) {        /* XXX Oraperl  */
> |         ^~
> In file included from /usr/lib64/perl5/CORE/perl.h:6186,
> from /usr/lib64/perl5/vendor_perl/auto/DBI/DBIXS.h:23,
> from Oracle.h:50,
> from Oracle.xs:1:
> /usr/lib64/perl5/CORE/proto.h:1031:1: note: declared here
> 1031 | Perl_dowantarray(pTHX)
--=_f0b12e9c81bc939bdcde832a838dd27d
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family: Tahoma,Aria=
l,Helvetica,sans-serif'>
<p>Hi,</p>
<p><br /></p>
<p>The deprecation warning might be related to <a href=3D"https://github.co=
m/perl5-dbi/dbi/pull/112">https://github.com/perl5-dbi/dbi/pull/112</a> / <=
a href=3D"https://github.com/perl5-dbi/dbi/issues/110">https://github.com/p=
erl5-dbi/dbi/issues/110</a>&nbsp; </p>
<p><br /></p>
<p>Dani&euml;l van Eeden</p>
<p id=3D"reply-intro">On 2024-11-24 14:29, Henrique Martins wrote:</p>
<blockquote type=3D"cite" style=3D"padding: 0 0.4em; border-left: #1010ff 2=
px solid; margin: 0">
<div class=3D"pre" style=3D"margin: 0; padding: 0; font-family: monospace">=
<br />Upgraded to Fedora 41, new compiler that comes with it seems to have =
-Wreturn-mismatch enabled.<br /><br />When trying to install DBD::Oracle wi=
th cpan, I get this error:<br />&nbsp; dbdcnx.c:90:25: error: &lsquo;return=
&rsquo; with no value, in function returning non-void [-Wreturn-mismatch]<b=
r />&nbsp; &nbsp;90 | &nbsp; &nbsp; if(llist_empty(el)) return;\<br /><br /=
>Looking at dbdcnx, the llist_drop(ael) macro does contain the return line =
above.<br /><br />The macro is used in functions<br /><br />&nbsp; release_=
env, which returns a void<br />&nbsp; find_env, which returns a env_box_t*<=
br />&nbsp; release_pool, which returns a void<br /><br />and the call with=
in find_env needs a "return NULL;" instead.<br /><br />I was able to make i=
t compile with two (silly) methods<br /><br />- duplicated the macro with<b=
r />&nbsp; return NULL<br />instead of<br />&nbsp; return<br />called it fr=
om find_env<br /><br />- added argument to the macro<br />&nbsp; llist_drop=
(ael, ret)<br />called it as<br />&nbsp; llist_drop(&amp;box-&gt;base.lock,=
 return);<br />or<br />&nbsp; llist_drop(&amp;box-&gt;base.lock, return NUL=
L);<br />where appropriate.<br /><br />Both approaches compile, have the fi=
rst one in place, will try the second later.<br /><br />-- Henrique<br /><b=
r />-----------------------------------------------------------------<br />=
<br />I also get a deprecation warning as below, didn't look at it<br /><br=
 />Oracle.xs: In function &lsquo;XS_DBD__Oracle__st_ora_fetch&rsquo;:<br />=
Oracle.xs:233:9: warning: &lsquo;Perl_dowantarray&rsquo; is deprecated [-Wd=
eprecated-declarations]<br />&nbsp; 233 | &nbsp; &nbsp; &nbsp; &nbsp; if (G=
IMME =3D=3D G_SCALAR) { &nbsp; &nbsp; &nbsp; &nbsp;/* XXX Oraperl &nbsp;*/<=
br />&nbsp; &nbsp; &nbsp; | &nbsp; &nbsp; &nbsp; &nbsp; ^~<br />In file inc=
luded from /usr/lib64/perl5/CORE/perl.h:6186,<br />&nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;from /usr/lib64/perl5/vendor_perl/aut=
o/DBI/DBIXS.h:23,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp;from Oracle.h:50,<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp;from Oracle.xs:1:<br />/usr/lib64/perl5/CORE/proto.h:10=
31:1: note: declared here<br />&nbsp;1031 | Perl_dowantarray(pTHX)<br /><br=
 /><br /><br />&nbsp; &nbsp; <br /><br />&nbsp; </div>
</blockquote>
</body></html>

--=_f0b12e9c81bc939bdcde832a838dd27d--