Compare commits

...
Sign in to create a new pull request.

2 commits

Author SHA1 Message Date
Benjamin A. Beasley
5164c816b9 Update to 0.41.0 (close RHBZ#2186353) 2023-04-19 09:28:58 -04:00
Benjamin A. Beasley
322d3774b1 Confirm License is SPDX MIT 2023-04-19 09:28:58 -04:00
4 changed files with 80 additions and 3 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
/gsl-lite-0.38.1.tar.gz
/gsl-lite-0.39.0.tar.gz
/gsl-lite-0.40.0.tar.gz
/gsl-lite-0.41.0.tar.gz

54
338.patch Normal file
View file

@ -0,0 +1,54 @@
From 194341fd519435ce3e47526296abb1196c1c8f6e Mon Sep 17 00:00:00 2001
From: "Benjamin A. Beasley" <code@musicinmybrain.net>
Date: Tue, 18 Apr 2023 08:00:15 -0400
Subject: [PATCH 1/2] Cast char to signed to avoid type-limits warning
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
On at least GCC 13, on platforms where char is unsigned by default,
checking if a char’s value is nonnegative by comparing to integer zero
produced a warning which was treated as an error: “comparison is always
true due to limited range of data type [-Werror=type-limits]”
Fixes #337.
---
test/lest_cpp03.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/lest_cpp03.hpp b/test/lest_cpp03.hpp
index a678b3e5..2ca078dd 100644
--- a/test/lest_cpp03.hpp
+++ b/test/lest_cpp03.hpp
@@ -704,7 +704,7 @@ inline void inform( location where, text expr )
// Expression decomposition:
-inline bool unprintable( char c ) { return 0 <= c && c < ' '; }
+inline bool unprintable( char c ) { return 0 <= static_cast<signed char>(c) && c < ' '; }
inline std::string to_hex_string(char c)
{
From 7f31a5c853b0b94d4cfed793d1ea5e980df1ac95 Mon Sep 17 00:00:00 2001
From: Moritz Beutel <mbeutel@users.noreply.github.com>
Date: Tue, 18 Apr 2023 14:50:55 +0200
Subject: [PATCH 2/2] Add explaining comment
---
test/lest_cpp03.hpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/lest_cpp03.hpp b/test/lest_cpp03.hpp
index 2ca078dd..ede4db06 100644
--- a/test/lest_cpp03.hpp
+++ b/test/lest_cpp03.hpp
@@ -704,7 +704,7 @@ inline void inform( location where, text expr )
// Expression decomposition:
-inline bool unprintable( char c ) { return 0 <= static_cast<signed char>(c) && c < ' '; }
+inline bool unprintable( char c ) { return 0 <= static_cast<signed char>(c) && c < ' '; } // the cast is necessary on architectures where char is unsigned
inline std::string to_hex_string(char c)
{

View file

@ -9,14 +9,36 @@ originally based on Microsoft GSL.
%global debug_package %{nil}
Name: gsl-lite
Version: 0.40.0
Version: 0.41.0
Release: %autorelease
Summary: Header-only version of ISO C++ Guidelines Support Library (GSL)
# The entire source is (SPDX) MIT, except the following files, which are
# BSL-1.0 but do not contribute to the licenses of the binary RPMs because they
# belong to the maintainer scripts or test suite.
# - script/create-cov-rpt.py
# - script/create-vcpkg.py
# - script/upload-conan.py
# - test/lest_cpp03.hpp
License: MIT
URL: https://github.com/gsl-lite/gsl-lite
Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Cast char to signed to avoid type-limits warning
# https://github.com/gsl-lite/gsl-lite/pull/338
#
# On at least GCC 13, on platforms where char is unsigned by default,
# checking if a char’s value is nonnegative by comparing to integer zero
# produced a warning which was treated as an error: “comparison is always
# true due to limited range of data type [-Werror=type-limits]”
#
# Fixes #337.
#
# Tests fail to compile due to -Werror=type-limits when char is unsigned
# https://github.com/gsl-lite/gsl-lite/issues/337
Patch: %{url}/pull/338.patch
BuildRequires: cmake
BuildRequires: gcc-c++
@ -34,7 +56,7 @@ developing applications that use %{name}.
%prep
%autosetup -n %{name}-%{version}
%autosetup -p1
%build

View file

@ -1 +1 @@
SHA512 (gsl-lite-0.40.0.tar.gz) = afd65009bf33f54cd1caf1988b725e618bee4f4f779825ae1df55017034c6fff75feaa737a358a7f5e690757637f4d281c2f22d06c39efb81dacd7d1949251df
SHA512 (gsl-lite-0.41.0.tar.gz) = 1b40ffc9d88ace3c2d145ed06a392124a265802e1eabe0cdffbf29c41bd1f0e2ef0fa4dd8ce635594881acc983f05f670a00964916a5504d7c3ed03aa4059d4b