DBD::Oracle fails to compile on Fedora 41

[email protected] (Henrique Martins) Sun, 24 Nov 2024 05:29:49 -0800
Newsgroups perl.dbi.dev
Message-ID <[email protected]>
Upgraded to Fedora 41, new compiler that comes with it seems to have -Wretu=
rn-mismatch enabled.

When trying to install DBD::Oracle with cpan, I get this error:
  dbdcnx.c:90:25: error: =E2=80=98return=E2=80=99 with no value, in functio=
n returning non-void [-Wreturn-mismatch]
   90 |     if(llist_empty(el)) return;\

Looking at dbdcnx, the llist_drop(ael) macro does contain the return line a=
bove.

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 l=
ater.

-- Henrique

-----------------------------------------------------------------

I also get a deprecation warning as below, didn't look at it

Oracle.xs: In function =E2=80=98XS_DBD__Oracle__st_ora_fetch=E2=80=99:
Oracle.xs:233:9: warning: =E2=80=98Perl_dowantarray=E2=80=99 is deprecated =
[-Wdeprecated-declarations]
  233 |         if (GIMME =3D=3D 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)



=20=20=20=20

=20=20