Fix compiler warnings

epel9
Petr Písař 12 years ago
parent 955cf71460
commit 8091e8f2af

@ -0,0 +1,66 @@
From 1394dd08b2284a0f83fac63025d19b66653d6585 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com>
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 <ctype.h>
#include <stdio.h>
#include <stdlib.h>
@@ -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

@ -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
# <http://lists.gnu.org/archive/html/bug-indent/2012-02/msg00000.html>
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 <ppisar@redhat.com> - 2.2.11-9
- Fix compiler warnings
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.11-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

Loading…
Cancel
Save