From 8091e8f2afaa1958091356b2469d93ec539dee00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Tue, 19 Feb 2013 15:01:31 +0100 Subject: [PATCH] Fix compiler warnings --- indent-2.2.11-Fix-compiler-warnings.patch | 66 +++++++++++++++++++++++ indent.spec | 12 ++++- 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 indent-2.2.11-Fix-compiler-warnings.patch diff --git a/indent-2.2.11-Fix-compiler-warnings.patch b/indent-2.2.11-Fix-compiler-warnings.patch new file mode 100644 index 0000000..30dab2d --- /dev/null +++ b/indent-2.2.11-Fix-compiler-warnings.patch @@ -0,0 +1,66 @@ +From 1394dd08b2284a0f83fac63025d19b66653d6585 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= +Date: Tue, 19 Feb 2013 11:34:25 +0100 +Subject: [PATCH 1/2] Fix compiler warnings + +--- + src/args.c | 6 ++++++ + src/lexi.c | 10 ---------- + 2 files changed, 6 insertions(+), 10 deletions(-) + +diff --git a/src/args.c b/src/args.c +index f392cce..abd2a6a 100644 +--- a/src/args.c ++++ b/src/args.c +@@ -62,6 +62,10 @@ + /* Argument scanning and profile reading code. Default parameters are set + * here as well. */ + ++#ifndef _XOPEN_SOURCE ++#define _XOPEN_SOURCE 500 /* strdup(3) */ ++#endif ++ + #include + #include + #include +@@ -174,7 +178,9 @@ static int exp_o = 0; + static int exp_orig = 0; + static int exp_pcs = 0; + static int exp_pi = 0; ++#ifdef PRESERVE_MTIME + static int exp_pmt = 0; ++#endif + static int exp_pro = 0; + static int exp_prs = 0; + static int exp_psl = 0; +diff --git a/src/lexi.c b/src/lexi.c +index abc2bfa..ef80e38 100644 +--- a/src/lexi.c ++++ b/src/lexi.c +@@ -198,11 +198,6 @@ int main (void) + #endif + + /* Include code generated by gperf */ +-#ifdef __GNUC__ +-__inline +-#endif +-templ_ty *is_reserved (const char *str, unsigned int len); +- + #include "gperf.c" + + /* Include code generated by gperf for C++ keyword set */ +@@ -212,11 +207,6 @@ templ_ty *is_reserved (const char *str, unsigned int len); + #undef MIN_WORD_LENGTH + #undef MAX_WORD_LENGTH + +-#ifdef __GNUC__ +-__inline +-#endif +-templ_ty *is_reserved_cc (register const char *str, register unsigned int len); +- + #include "gperf-cc.c" + + /** +-- +1.8.1.2 + diff --git a/indent.spec b/indent.spec index 700131f..9cc5057 100644 --- a/indent.spec +++ b/indent.spec @@ -2,7 +2,7 @@ Summary: A GNU program for formatting C code Name: indent Version: 2.2.11 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv3+ Group: Applications/Text URL: http://indent.isidore-it.eu/beautify.html @@ -15,6 +15,10 @@ Patch8: indent-2.2.11-Do-not-split-decimal-float-suffix-from-constant.patch # Submitted to upstream # Patch9: indent-2.2.11-Return-non-zero-exit-code-on-tests-failure.patch +# Submitted to upstream +Patch10: indent-2.2.11-Fix-compiler-warnings.patch +# gperf to update pre-generated code to fix compiler warnings +BuildRequires: gperf BuildRequires: texinfo texi2html Requires(post): /sbin/install-info Requires(preun): /sbin/install-info @@ -34,6 +38,9 @@ you want a program to format your code. %patch7 -p1 %patch8 -p1 -b .float_suffix %patch9 -p1 -b .exit_code +%patch10 -p1 -b .warnings +# Regenerate sources +rm src/gperf.c src/gperf-cc.c %build %configure @@ -65,6 +72,9 @@ fi %changelog +* Tue Feb 19 2013 Petr Pisar - 2.2.11-9 +- Fix compiler warnings + * Thu Feb 14 2013 Fedora Release Engineering - 2.2.11-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild