1
0

Accepting request 1155816 from devel:languages:perl

OBS-URL: https://build.opensuse.org/request/show/1155816
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/perl-DBD-mysql?expand=0&rev=57
This commit is contained in:
Ana Guerrero 2024-03-08 17:07:38 +00:00 committed by Git OBS Bridge
commit 42d41a19ca
4 changed files with 53 additions and 6 deletions

View File

@ -4,9 +4,8 @@ description_paragraphs: 1
#sources:
# - source1
# - source2
#patches:
# foo.patch: -p1
# bar.patch:
patches:
perl-DBD-mysql-gcc14.patch: -p1
preamble: |-
BuildRequires: libmariadb-devel
BuildRequires: zlib-devel

View File

@ -0,0 +1,40 @@
From 93bc876808af048091bf76d6908a9748d0476ab9 Mon Sep 17 00:00:00 2001
From: Eric Herman <eric@freesa.org>
Date: Thu, 10 Jan 2019 10:22:38 +0100
Subject: [PATCH] Fix "assignment from incompatible pointer type"
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
I encountered this warning from gcc 7.3.0 building on Ubuntu:
dbdimp.c: In function mysql_st_prepare:
dbdimp.c:3207:24: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types]
bind->is_null= (_Bool*) &(fbind->is_null);
The "MYSQL_BIND" field "is_null" is of type "my_bool", not "_Bool".
The type "my_bool" is (usually) type-defined to be of a "char" type.
Regardless, the "imp_sth_phb_t" field "is_null" is of type "char".
This commit removes the cast, which means that if we later discover
that "my_bool" is defined to be of a type incompatible with the
"imp_sth_phb_t" field "is_null", it will break at compile-time.
---
dbdimp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dbdimp.c b/dbdimp.c
index b0399d94..e7e6c007 100644
--- a/dbdimp.c
+++ b/dbdimp.c
@@ -3204,7 +3204,7 @@ dbd_st_prepare(
bind->buffer_type= MYSQL_TYPE_STRING;
bind->buffer= NULL;
bind->length= &(fbind->length);
- bind->is_null= (_Bool*) &(fbind->is_null);
+ bind->is_null= &(fbind->is_null);
fbind->is_null= 1;
fbind->length= 0;
}

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 6 13:55:14 UTC 2024 - Pedro Monreal <pmonreal@suse.com>
- Fix build with gcc14: [bsc#1221011]
* Upstream PR: https://github.com/perl5-dbi/DBD-mysql/pull/295
* Add perl-DBD-mysql-gcc14.patch
-------------------------------------------------------------------
Wed Feb 13 15:05:24 UTC 2019 - Vítězslav Čížek <vcizek@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package perl-DBD-mysql
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -23,9 +23,10 @@ Release: 0
Summary: MySQL driver for the Perl5 Database Interface (DBI)
License: Artistic-1.0 OR GPL-1.0-or-later
Group: Development/Libraries/Perl
Url: https://metacpan.org/release/%{cpan_name}
URL: https://metacpan.org/release/%{cpan_name}
Source0: https://cpan.metacpan.org/authors/id/D/DV/DVEEDEN/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
Patch0: perl-DBD-mysql-gcc14.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
@ -49,7 +50,7 @@ are supported. Some rarely used functions are missing, mainly because
no-one ever requested them. :-)
%prep
%setup -q -n %{cpan_name}-%{version}
%autosetup -p1 -n %{cpan_name}-%{version}
find . -type f ! -name \*.pl -print0 | xargs -0 chmod 644
%build