Fix build with new GCC
Signed-off-by: Ondrej Mosnacek <omosnace@redhat.com>
This commit is contained in:
parent
459efb3df3
commit
2a261ac6a0
51
000-Fix-build-with-gcc-8.2.x.patch
Normal file
51
000-Fix-build-with-gcc-8.2.x.patch
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
From 52620ec798a580b2053d16a42362e9926729eb30 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||||
|
Date: Sun, 20 Jan 2019 20:04:13 +0100
|
||||||
|
Subject: [PATCH] apps/kcapi-hasher.c: fix build with gcc 8.2.x
|
||||||
|
|
||||||
|
Fixes:
|
||||||
|
- http://autobuild.buildroot.org/results/8355bc42238e885f7f11ed3d9d37fc55ebdead2b
|
||||||
|
|
||||||
|
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||||
|
Signed-off-by: Stephan Mueller <smueller@chronox.de>
|
||||||
|
---
|
||||||
|
apps/kcapi-hasher.c | 12 ++++++++----
|
||||||
|
1 file changed, 8 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/apps/kcapi-hasher.c b/apps/kcapi-hasher.c
|
||||||
|
index d6be685..7172b12 100644
|
||||||
|
--- a/apps/kcapi-hasher.c
|
||||||
|
+++ b/apps/kcapi-hasher.c
|
||||||
|
@@ -357,16 +357,20 @@ static int hasher(struct kcapi_handle *handle, const struct hash_params *params,
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * GCC v8.1.0 introduced -Wstringop-truncation but it is not smart enough to
|
||||||
|
- * find that cursor string will be NULL-terminated after all paste() calls and
|
||||||
|
- * warns with:
|
||||||
|
+ * GCC v8.1.0 introduced -Wstringop-truncation and GCC v8.2.0 introduced
|
||||||
|
+ * -Wstringop-overflow but it is not smart enough to find that cursor string
|
||||||
|
+ * will be NULL-terminated after all paste() calls and warns with:
|
||||||
|
* error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation]
|
||||||
|
* error: 'strncpy' output truncated before terminating nul copying 5 bytes from a string of the same length [-Werror=stringop-truncation]
|
||||||
|
+ * error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
|
||||||
|
*/
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#if GCC_VERSION >= 80100
|
||||||
|
#pragma GCC diagnostic ignored "-Wstringop-truncation"
|
||||||
|
#endif
|
||||||
|
+#if GCC_VERSION >= 80200
|
||||||
|
+#pragma GCC diagnostic ignored "-Wstringop-overflow"
|
||||||
|
+#endif
|
||||||
|
static char *paste(char *dst, const char *src, size_t size)
|
||||||
|
{
|
||||||
|
strncpy(dst, src, size);
|
||||||
|
@@ -417,7 +421,7 @@ static char *get_hmac_file(const char *filename, const char *checkdir)
|
||||||
|
strncpy(cursor, "\0", 1);
|
||||||
|
return checkfile;
|
||||||
|
}
|
||||||
|
-#pragma GCC diagnostic pop /* -Wstringop-truncation */
|
||||||
|
+#pragma GCC diagnostic pop /* -Wstringop-truncation -Wstringop-overflow */
|
||||||
|
|
||||||
|
static int hash_files(const struct hash_params *params,
|
||||||
|
char *filenames[], uint32_t files,
|
@ -105,6 +105,8 @@ URL: http://www.chronox.de/%{name}.html
|
|||||||
Source0: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz
|
Source0: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz
|
||||||
Source1: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc
|
Source1: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc
|
||||||
|
|
||||||
|
Patch0: %{giturl}/commit/52620ec798a5.patch#/000-Fix-build-with-gcc-8.2.x.patch
|
||||||
|
|
||||||
BuildRequires: clang
|
BuildRequires: clang
|
||||||
BuildRequires: coreutils
|
BuildRequires: coreutils
|
||||||
BuildRequires: cppcheck
|
BuildRequires: cppcheck
|
||||||
@ -445,6 +447,9 @@ popd
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Feb 01 2019 Ondrej Mosnáček <omosnace@redhat.com> - 1.1.3-3
|
||||||
|
- Fix build with new GCC
|
||||||
|
|
||||||
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-2
|
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.1.3-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user