[idris] fix fprinf Wall for missing format string
Jens Petersen
petersen at fedoraproject.org
Fri Feb 6 14:53:15 UTC 2015
commit f26fa8cd96a7cf534043a983732730978e11cf4f
Author: Jens Petersen <petersen at redhat.com>
Date: Fri Feb 6 15:50:33 2015 +0100
fix fprinf Wall for missing format string
gcc -fPIC -O2 -Wall -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m32 -march=i686 -mtune=atom -fasynchronous-unwind-tables -c -o idris_opts.o idris_opts.c
idris_opts.c: In function 'print_usage':
idris_opts.c:20:16: error: format not a string literal and no format arguments [-Werror=format-security]
fprintf(s, usage);
^
idris-rts-opt-fprintf.patch | 11 +++++++++++
idris.spec | 2 ++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/idris-rts-opt-fprintf.patch b/idris-rts-opt-fprintf.patch
new file mode 100644
index 0000000..5262153
--- /dev/null
+++ b/idris-rts-opt-fprintf.patch
@@ -0,0 +1,11 @@
+--- idris-0.9.9.1/rts/idris_opts.c~ 2013-09-20 00:27:13.000000000 +0200
++++ idris-0.9.9.1/rts/idris_opts.c 2015-02-06 15:48:21.986185276 +0100
+@@ -17,7 +17,7 @@
+ "\n";
+
+ void print_usage(FILE * s) {
+- fprintf(s, usage);
++ fprintf(s, "%s", usage);
+ }
+
+ int read_size(char * str) {
diff --git a/idris.spec b/idris.spec
index d4ca41f..6c5060e 100644
--- a/idris.spec
+++ b/idris.spec
@@ -9,6 +9,7 @@ License: BSD
Url: https://hackage.haskell.org/package/%{name}
Source0: https://hackage.haskell.org/package/%{name}-%{version}/%{name}-%{version}.tar.gz
Patch0: idris-ASTBuilding-ghc78.patch
+Patch1: idris-rts-opt-fprintf.patch
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-rpm-macros
@@ -65,6 +66,7 @@ closely related to Epigram and Agda. There is a tutorial at
%prep
%setup -q
%patch0 -p1 -b .orig
+%patch1 -p1 -b .orig
cabal-tweak-flag LLVM False
More information about the scm-commits
mailing list