Testing gnucash-gnome2 on NetBSD: autoconf problems

Thomas Klausner tk at giga.or.at
Wed Jan 11 13:03:17 EST 2006


On Wed, Jan 11, 2006 at 10:45:16AM +0100, Christian Stimming wrote:
> That's wrong. As written in README and HACKING and README.cvs and (... 
> insert other gnucash documentation here...), you are supposed to run
> 
>   ./autogen.sh
> 
> which will find all the macros in question. ("aclocal" itself is missing 
> the argument "-I macros".)

Thanks for the pointer.
To my defense: it's only explicitly in README.svn :)

Ok, now to the problems I found so far:

First, a warning from guile:
	FLAVOR=gnome /usr/pkg/bin/guile -c \
          	"(set! %load-path (cons \"/usr/pkg/share/guile/site\" %load-path)) \
           	(primitive-load \"./gw-core-utils-spec.scm\") \
           	(gw:generate-wrapset \"gw-core-utils\")"

	Some deprecated features have been used.  Set the environment
	variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
	program to get more information.  Set it to "no" to suppress
	this message.
This appears in other places too, but is not fatal.

A sed in doc/Makefile* ends with "m", which NetBSD's sed doesn't
understand.  I removed it for now, perhaps it needs to be replaced
with something else? (included in the patch)

In lots of places, "char" is passed to a ctype.h function.
The NetBSD man pages for the ctype functions all contain paragraphs
of the type:
CAVEATS
     The argument to isalpha() must be EOF or representable as an unsigned
     char; otherwise, the result is undefined.
and since warnings are turned into errors by the recommended configure
arguments ("--enable-error-on-warning --enable-compile-warnings",
given after autogen runs), I fixed them.

With the attached patch, r12322 compiles fine. I haven't run it yet.

Cheers,
 Thomas
-------------- next part --------------
Index: src/backend/file/io-example-account.c
===================================================================
--- src/backend/file/io-example-account.c	(revision 12322)
+++ src/backend/file/io-example-account.c	(working copy)
@@ -157,7 +157,7 @@
 }
 
 static char*
-squash_extra_whitespace(char *text)
+squash_extra_whitespace(unsigned char *text)
 {
     int spot;
     int length = strlen(text);
Index: src/backend/file/sixtp-utils.c
===================================================================
--- src/backend/file/sixtp-utils.c	(revision 12322)
+++ src/backend/file/sixtp-utils.c	(working copy)
@@ -55,7 +55,7 @@
 gboolean
 isspace_str(const gchar *str, int nomorethan)
 {
-  const gchar *cursor = str;
+  const guchar *cursor = str;
   while(*cursor && (nomorethan != 0)) {
     if(!isspace(*cursor)) {
       return(FALSE);
@@ -233,7 +233,7 @@
    * is fixed in the next release 10.2 afaik
    */  
   while( (*((gchar*)str + num_read)!='\0') &&
-	 isspace(*((char*)str + num_read)))
+	 isspace(*((unsigned char*)str + num_read)))
     num_read++;
 
   if (v)
@@ -259,7 +259,7 @@
     return(FALSE);
   }
   while( (*((gchar*)str + num_read)!='\0') &&
-	 isspace(*((char*)str + num_read)))
+	 isspace(*((unsigned char*)str + num_read)))
     num_read++;
 
   if (v)
@@ -277,7 +277,7 @@
 hex_string_to_binary(const gchar *str,  void **v, guint64 *data_len)
 {
   /* Convert a hex string to binary.  No whitespace allowed. */
-  const gchar *cursor = str;
+  const guchar *cursor = str;
   guint64 str_len;
   gboolean error = FALSE;
   
@@ -501,7 +501,7 @@
 
   sscanf(str, " %ld%n", &nanosecs, &charcount);
   while( (*((gchar*)str + charcount)!='\0') &&
-	 isspace(*((char*)str + charcount)))
+	 isspace(*((unsigned char*)str + charcount)))
     charcount++;
 
   if(charcount != strlen(str)) return(FALSE);
Index: src/backend/file/sixtp.c
===================================================================
--- src/backend/file/sixtp.c	(revision 12322)
+++ src/backend/file/sixtp.c	(working copy)
@@ -750,7 +750,7 @@
 
 /***********************************************************************/
 static gboolean
-eat_whitespace(char **cursor)
+eat_whitespace(unsigned char **cursor)
 {
     while(**cursor && isspace(**cursor))
     {
@@ -768,7 +768,7 @@
 }
 
 static gboolean
-search_for(char marker, char **cursor)
+search_for(unsigned char marker, unsigned char **cursor)
 {
     while(**cursor && **cursor != marker)
     {
@@ -791,7 +791,7 @@
 {
   FILE *f = NULL;
   char first_chunk[256];
-  char* cursor = NULL;
+  unsigned char* cursor = NULL;
   ssize_t num_read;
   
   g_return_val_if_fail(filename, FALSE);
Index: src/calculation/expression_parser.c
===================================================================
--- src/calculation/expression_parser.c	(revision 12322)
+++ src/calculation/expression_parser.c	(working copy)
@@ -760,7 +760,7 @@
 next_token (parser_env_ptr pe)
 {
   char *nstr;
-  const char *str_parse = pe->parse_str;
+  const unsigned char *str_parse = pe->parse_str;
   void *number;
 
   while (isspace (*str_parse))
Index: src/gnome-utils/gnc-date-edit.c
===================================================================
--- src/gnome-utils/gnc-date-edit.c	(revision 12322)
+++ src/gnome-utils/gnc-date-edit.c	(working copy)
@@ -782,7 +782,8 @@
 gnc_date_edit_get_date_internal (GNCDateEdit *gde)
 {
 	struct tm tm = {0};
-	char *str, *flags = NULL;
+	char *str;
+	unsigned char *flags = NULL;
 
 	/* Assert, because we're just hosed if it's NULL */
 	g_assert(gde != NULL);
@@ -800,7 +801,8 @@
 		tm.tm_year -= 1900;
 
 	if (gde->flags & GNC_DATE_EDIT_SHOW_TIME) {
-		char *tokp = NULL, *temp;
+		char *tokp = NULL;
+		unsigned char *temp;
 
 		str = g_strdup (gtk_entry_get_text
                                 (GTK_ENTRY (gde->time_entry)));
Index: src/gnome-utils/gnc-menu-extensions.c
===================================================================
--- src/gnome-utils/gnc-menu-extensions.c	(revision 12322)
+++ src/gnome-utils/gnc-menu-extensions.c	(working copy)
@@ -178,7 +178,7 @@
 gnc_ext_gen_action_name (const gchar *name)
 {
   //gchar *extName;
-  const gchar *extChar;
+  const guchar *extChar;
   GString *actionName;
 
   actionName = g_string_sized_new( strlen( name ) + 7 );
Index: src/app-utils/gnc-ui-util.h
===================================================================
--- src/app-utils/gnc-ui-util.h	(revision 12322)
+++ src/app-utils/gnc-ui-util.h	(working copy)
@@ -327,8 +327,8 @@
  */
 gboolean
 xaccParseAmountExtended (const char * in_str, gboolean monetary,
-			 char negative_sign, char decimal_point,
-			 char group_separator, char *group, char *ignore_list,
+			 char negative_sign, unsigned char decimal_point,
+			 unsigned char group_separator, char *group, char *ignore_list,
 			 gnc_numeric *result, char **endstr);
 
 /* Initialization ***************************************************/
Index: src/app-utils/gnc-ui-util.c
===================================================================
--- src/app-utils/gnc-ui-util.c	(revision 12322)
+++ src/app-utils/gnc-ui-util.c	(working copy)
@@ -1586,8 +1586,8 @@
 
 gboolean
 xaccParseAmountExtended (const char * in_str, gboolean monetary,
-			 char negative_sign, char decimal_point,
-			 char group_separator, char *group, char *ignore_list,
+			 char negative_sign, unsigned char decimal_point,
+			 unsigned char group_separator, char *group, char *ignore_list,
 			 gnc_numeric *result, char **endstr)
 {
   gboolean is_negative;
@@ -1600,7 +1600,7 @@
 
   ParseState state;
 
-  const char *in;
+  const unsigned char *in;
   char *out_str;
   char *out;
 
Index: doc/Makefile.am
===================================================================
--- doc/Makefile.am	(revision 12322)
+++ doc/Makefile.am	(working copy)
@@ -55,7 +55,7 @@
 
 tip_of_the_day.list: tip_of_the_day.list.in
 	gcc -E -P -x c -D'N_(x)=x' -o $@.tmp $<
-	cat -s $@.tmp | ${SED} -e 's/^ *\"\(.*\)\" *$$/\1/m' > $@
+	cat -s $@.tmp | ${SED} -e 's/^ *\"\(.*\)\" *$$/\1/' > $@
 	rm -f $@.tmp
 
 DISTCLEANFILES = gnc-prices.1 gnucash.1 tip_of_the_day.list
Index: lib/libqof/qof/guid.c
===================================================================
--- lib/libqof/qof/guid.c	(revision 12322)
+++ lib/libqof/qof/guid.c	(working copy)
@@ -548,11 +548,11 @@
  * a hex number. returns false otherwise. Decoded number
  * is packed into data in little endian order. */
 static gboolean
-decode_md5_string(const char *string, unsigned char *data)
+decode_md5_string(const unsigned char *string, unsigned char *data)
 {
   unsigned char n1, n2;
   size_t count = -1;
-  char c1, c2;
+  unsigned char c1, c2;
 
   if (NULL == data) return FALSE;
   if (NULL == string) goto badstring;
Index: lib/libqof/qof/gnc-date.c
===================================================================
--- lib/libqof/qof/gnc-date.c	(revision 12322)
+++ lib/libqof/qof/gnc-date.c	(working copy)
@@ -934,10 +934,10 @@
         return locale_separator;
       else
       { /* Make a guess */
-        char string[256];
+        unsigned char string[256];
         struct tm *tm;
         time_t secs;
-        char *s;
+        unsigned char *s;
 
         secs = time(NULL);
         tm = localtime(&secs);
@@ -1055,7 +1055,7 @@
 
     str +=3;
     if ('.' == *str) str++;
-    if (isdigit (*str) && isdigit (*(str+1)))
+    if (isdigit ((unsigned char)*str) && isdigit ((unsigned char)*(str+1)))
     {
       int cyn;
       /* copy sign from hour part */
Index: lib/libqof/qof/gnc-engine-util.c
===================================================================
--- lib/libqof/qof/gnc-engine-util.c	(revision 12322)
+++ lib/libqof/qof/gnc-engine-util.c	(working copy)
@@ -40,7 +40,7 @@
 /* Search for str2 in first nchar chars of str1, ignore case..  Return
  * pointer to first match, or null.  */
 char *
-strncasestr(const char *str1, const char *str2, size_t len) 
+strncasestr(const unsigned char *str1, const unsigned char *str2, size_t len) 
 {
   while (*str1 && len--) 
   {
@@ -145,7 +145,7 @@
 \********************************************************************/
 
 gboolean
-gnc_strisnum(const char *s)
+gnc_strisnum(const unsigned char *s)
 {
   if (s == NULL) return FALSE;
   if (*s == 0) return FALSE;
Index: lib/libqof/qof/gnc-engine-util.h
===================================================================
--- lib/libqof/qof/gnc-engine-util.h	(revision 12322)
+++ lib/libqof/qof/gnc-engine-util.h	(working copy)
@@ -226,7 +226,7 @@
 /** Search for str2 in first nchar chars of str1, ignore case. Return
  * pointer to first match, or null. These are just like that strnstr
  * and the strstr functions, except that they ignore the case. */
-extern char *strncasestr(const char *str1, const char *str2, size_t len);
+extern char *strncasestr(const unsigned char *str1, const unsigned char *str2, size_t len);
 extern char *strcasestr(const char *str1, const char *str2);
 
 /** The ultostr() subroutine is the inverse of strtoul(). It accepts a
@@ -236,7 +236,7 @@
 
 /** Returns true if string s is a number, possibly surrounded by
  * whitespace. */
-gboolean gnc_strisnum(const char *s);
+gboolean gnc_strisnum(const unsigned char *s);
 
 /** Local copy of stpcpy, used wtih libc's that don't have one. */
 char * gnc_stpcpy (char *dest, const char *src);


More information about the gnucash-devel mailing list