!10 Add -Wunreachable-code

From: @cao-fei8 
Reviewed-by: @Charlie_li 
Signed-off-by: @Charlie_li
This commit is contained in:
openeuler-ci-bot 2023-07-18 12:56:59 +00:00 committed by Gitee
commit f3531e9594
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,24 @@
From 45cafb3157d74a8ac718a9278ae88da841d5c647 Mon Sep 17 00:00:00 2001
From: Dave Beckett <dave@dajobe.org>
Date: Thu, 27 Feb 2014 09:38:02 -0600
Subject: [PATCH] Add -Wunreachable-code
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index b7b220ae..15def330 100644
--- a/configure.ac
+++ b/configure.ac
@@ -233,6 +233,7 @@ possible_warnings="\
-Wstrict-prototypes \
-Wswitch-enum \
-Wundef \
+-Wunreachable-code \
-Wunsafe-loop-optimizations \
-Wwrite-strings \
\
--
2.33.0

View File

@ -1,12 +1,13 @@
Name: redland Name: redland
Version: 1.0.17 Version: 1.0.17
Release: 19 Release: 20
Summary: RDF iprovids support for the Resource Description Framework. Summary: RDF iprovids support for the Resource Description Framework.
License: LGPLv2+ or ASL 2.0 License: LGPLv2+ or ASL 2.0
URL: http://librdf.org/ URL: http://librdf.org/
Source0: http://download.librdf.org/source/%{name}-%{version}.tar.gz Source0: http://download.librdf.org/source/%{name}-%{version}.tar.gz
Patch0: 0001-Fix-unreachable-codes-break-after-return-mostly.patch Patch0: 0001-Fix-unreachable-codes-break-after-return-mostly.patch
Patch6000: 0001-Add-Wunreachable-code.patch
BuildRequires: curl-devel gcc-c++ libdb-devel libtool-ltdl-devel libxml2-devel >= 2.4.0 mysql-devel BuildRequires: curl-devel gcc-c++ libdb-devel libtool-ltdl-devel libxml2-devel >= 2.4.0 mysql-devel
BuildRequires: perl-interpreter postgresql-devel raptor2-devel rasqal-devel >= 0.9.26 BuildRequires: perl-interpreter postgresql-devel raptor2-devel rasqal-devel >= 0.9.26
@ -114,6 +115,9 @@ make check
%changelog %changelog
* Tue Jul 18 2023 caofei <caofei@xfusion.com> - 1.0.17-20
- Add -Wunreachable-code
* Tue Jan 17 2023 caofei <caofei@xfusion.com> - 1.0.17-19 * Tue Jan 17 2023 caofei <caofei@xfusion.com> - 1.0.17-19
- Fix unreachable codes - break after return mostly - Fix unreachable codes - break after return mostly