[qstars] Patch to compile with -Werror=format-security
Mamoru TASAKA
mtasaka at fedoraproject.org
Mon Jun 9 04:18:56 UTC 2014
commit 908e148675185ab44d1c9003748581f371e45ea5
Author: Mamoru TASAKA <mtasaka at fedoraproject.org>
Date: Mon Jun 9 13:18:45 2014 +0900
Patch to compile with -Werror=format-security
qstars-0.4-format-security.patch | 31 +++++++++++++++++++++++++++++++
qstars.spec | 8 +++++---
2 files changed, 36 insertions(+), 3 deletions(-)
---
diff --git a/qstars-0.4-format-security.patch b/qstars-0.4-format-security.patch
new file mode 100644
index 0000000..1e558c6
--- /dev/null
+++ b/qstars-0.4-format-security.patch
@@ -0,0 +1,31 @@
+--- qstars-0.4/main.cpp.format 2005-02-13 04:17:53.000000000 +0900
++++ qstars-0.4/main.cpp 2014-06-09 13:15:59.069975521 +0900
+@@ -33,6 +33,8 @@
+
+ if(mode == "-help")
+ {
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wformat-security"
+ qWarning("Usage: " +QString(app.argv()[0])+ " [options]\n"
+ "QStars Screensaver\n"
+ "Options:\n"
+@@ -41,6 +43,7 @@
+ " -window-id wid Run in the specified XWindow.\n"
+ " -root Run in the root XWindow.\n"
+ " -demo Start screen saver in demo mode. [default]\n");
++#pragma GCC diagnostic pop
+ }
+ else if(mode == "-setup")
+ {
+@@ -122,8 +125,11 @@
+ }
+ else
+ {
++#pragma GCC diagnostic push
++#pragma GCC diagnostic ignored "-Wformat-security"
+ qWarning("Unknown option: " + mode +
+ "\nUse -help to get a list of available command line options.\n");
++#pragma GCC diagnostic pop
+ }
+ return 0;
+ }
diff --git a/qstars.spec b/qstars.spec
index c50a143..039b712 100644
--- a/qstars.spec
+++ b/qstars.spec
@@ -18,6 +18,8 @@ Source0: http://qt.osdn.org.ua/%{name}-%{version}.tar.gz
Source1: %{name}.setup
Source2: %{name}.conf
Patch0: %{name}-0.4-desktop.patch
+# Patch to build with -Werror=format-security
+Patch1: qstars-0.4-format-security.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: qt3-devel >= 3.3
@@ -57,11 +59,11 @@ starfield. This package contains the files needed to use the hack with KDE.
%prep
%setup -q
%patch0 -p0 -b .orig
+%patch1 -p1 -b .format
# Set installation in project file
sed -i 's|/local/|/|' %{name}.pro
-
%build
qmake
make clean
@@ -121,8 +123,8 @@ fi
%changelog
-* Sun Jun 08 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.4-14
-- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
+* Mon Jun 9 2014 Mamoru TASAKA <mtasaka at fedoraproject.org> - 0.4-14
+- Patch to compile with -Werror=format-security
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.4-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
More information about the scm-commits
mailing list