Fix undesirable strncpy call to instead use memcpy to avoid

gcc-11 diagnostic
This commit is contained in:
Jeff Law 2020-12-04 21:42:01 -07:00
parent 67df70f921
commit d5cee58231
2 changed files with 19 additions and 1 deletions

13
spirv-tools-gcc11.patch Normal file
View File

@ -0,0 +1,13 @@
diff --git a/source/diagnostic.cpp b/source/diagnostic.cpp
index edc27c8..77c29d7 100644
--- a/source/diagnostic.cpp
+++ b/source/diagnostic.cpp
@@ -37,7 +37,7 @@ spv_diagnostic spvDiagnosticCreate(const spv_position position,
diagnostic->position = *position;
diagnostic->isTextSource = false;
memset(diagnostic->error, 0, length);
- strncpy(diagnostic->error, message, length);
+ memcpy(diagnostic->error, message, length);
return diagnostic;
}

View File

@ -7,12 +7,13 @@
Name: spirv-tools Name: spirv-tools
Version: 2020.5 Version: 2020.5
Release: 2%{?gitrel}%{?dist} Release: 3%{?gitrel}%{?dist}
Summary: API and commands for processing SPIR-V modules Summary: API and commands for processing SPIR-V modules
License: ASL 2.0 License: ASL 2.0
URL: https://github.com/KhronosGroup/SPIRV-Tools URL: https://github.com/KhronosGroup/SPIRV-Tools
Source0: %url/archive/%{commit}.tar.gz#/%{name}-%{commit}.tar.gz Source0: %url/archive/%{commit}.tar.gz#/%{name}-%{commit}.tar.gz
Patch0: %{name}-gcc11.patch
BuildRequires: cmake3 BuildRequires: cmake3
BuildRequires: gcc-c++ BuildRequires: gcc-c++
@ -87,6 +88,10 @@ Development files for %{name}
%{_libdir}/pkgconfig/SPIRV-Tools.pc %{_libdir}/pkgconfig/SPIRV-Tools.pc
%changelog %changelog
* Fri Dec 04 2020 Jeff Law <law@redhat.com> - 2020.5-3.20201031.gitf7da5277
- Fix undesirable strncpy call to instead use memcpy to avoid
gcc-11 diagnostic
* Mon Nov 02 2020 Dave Airlie <airlied@redhat.com> - 2020.5-2.20201031.gitf7da5277 * Mon Nov 02 2020 Dave Airlie <airlied@redhat.com> - 2020.5-2.20201031.gitf7da5277
- update to latest spirv-tools - update to latest spirv-tools