[PATCH] hxindex: option is int not char

Sebastian Andrzej Siewior bigeasy at linutronix.de
Thu Jun 10 16:37:49 UTC 2010


the return value of getopt is int not char. The difference here is that
char is signed char on x86 but unsigned char on powerpc for instance.
This leads to the following compile error if compiled with -Wextra:

| hxindex.c:777: warning: comparison is always true due to limited range  of data type

because c can never get -1, it can however grow to 255 and the options
will never be parsed properly.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy at linutronix.de>
---
 hxindex.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/hxindex.c b/hxindex.c
index 47273be..b75c583 100644
--- a/hxindex.c
+++ b/hxindex.c
@@ -758,7 +758,7 @@ int main(int argc, char *argv[])
   Boolean write = True;
   Indexterm termtree = NULL;	/* Sorted tree of terms */
   string secno;
-  char c;
+  int c;
 
   /* Bind the parser callback routines to our handlers */
   set_error_handler(handle_error);
-- 
1.5.6.5


--x+6KMIRAuhnl3hBn--





More information about the debian-xml-sgml-pkgs mailing list