Bug#286952: gtranslator: FTBFS (amd64/gcc-4.0): pointer targets in passing argument 3 of 'xmlSetProp' differ in signedness

Andreas Jochens Andreas Jochens <aj@andaco.de>, 286952@bugs.debian.org
Thu, 23 Dec 2004 09:12:55 +0100


Package: gtranslator
Severity: normal
Tags: patch

When building 'gtranslator' on amd64 with gcc-4.0,
I get the following error:

semer-opentag.c:86: warning: pointer targets in passing argument 3 of 'xmlSetProp' differ in signedness
semer-opentag.c: In function 'semer_opentag_write_header':
semer-opentag.c:104: warning: pointer targets in passing argument 3 of 'xmlNewChild' differ in signedness
semer-opentag.c:116: warning: pointer targets in passing argument 2 of 'xmlSetProp' differ in signedness
semer-opentag.c:116: warning: pointer targets in passing argument 3 of 'xmlSetProp' differ in signedness
semer-opentag.c:117: warning: pointer targets in passing argument 2 of 'xmlSetProp' differ in signedness
semer-opentag.c:117: warning: pointer targets in passing argument 3 of 'xmlSetProp' differ in signedness
semer-opentag.c:118: warning: pointer targets in passing argument 2 of 'xmlSetProp' differ in signedness
semer-opentag.c:118: warning: pointer targets in passing argument 3 of 'xmlSetProp' differ in signedness
semer-opentag.c: In function 'semer_opentag_save_file':
semer-opentag.c:179: warning: pointer targets in passing argument 1 of 'xmlNewDoc' differ in signedness
make[4]: *** [semer-opentag.o] Error 1
make[4]: Leaving directory `/gtranslator-1.1.5/src/semerkent'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/gtranslator-1.1.5/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/gtranslator-1.1.5'
make[1]: *** [all-recursive-am] Error 2
make[1]: Leaving directory `/gtranslator-1.1.5'
make: *** [debian/stamp-makefile-build] Error 2

With the attached patch 'gtranslator' can be compiled
on amd64 using gcc-4.0.

Regards
Andreas Jochens

diff -urN ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-opentag.c ./src/semerkent/semer-opentag.c
--- ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-opentag.c	2003-01-12 12:45:01.000000000 +0100
+++ ./src/semerkent/semer-opentag.c	2004-12-23 08:37:18.000000000 +0100
@@ -49,7 +49,7 @@
 	/*
 	 * Search for the main <file> node of the OpenTag document.
 	 */
-	while(node && g_ascii_strcasecmp(node->name, "file"))
+	while(node && g_ascii_strcasecmp((char*)node->name, "file"))
 	{
 		node=node->next;
 	}
@@ -57,7 +57,7 @@
 	/*
 	 * Add the <grp> tag for a translation group entry.
 	 */
-	add_node=xmlNewChild(node, NULL, "grp", NULL);
+	add_node=xmlNewChild(node, NULL, (unsigned char*)"grp", NULL);
 
 	/*
 	 * Add eventual existing props informations to the translation group
@@ -65,25 +65,25 @@
 	 */
 	if(SEMER_PROPS(entry->props)->id)
 	{
-		xmlSetProp(add_node, "id", SEMER_PROPS(entry->props)->id);
+		xmlSetProp(add_node, (unsigned char*)"id", (unsigned char*)SEMER_PROPS(entry->props)->id);
 	}
 
 	if(SEMER_PROPS(entry->props)->domain)
 	{
-		xmlSetProp(add_node, "ts", SEMER_PROPS(entry->props)->domain);
+		xmlSetProp(add_node, (unsigned char*)"ts", (unsigned char*)SEMER_PROPS(entry->props)->domain);
 	}
 
 	/*
 	 * Add the original informations node.
 	 */
-	original_node=xmlNewChild(add_node, NULL, "p", entry->original);
-	xmlSetProp(original_node, "lc", entry->original_language);
+	original_node=xmlNewChild(add_node, NULL, (unsigned char*)"p", (unsigned char*)entry->original);
+	xmlSetProp(original_node, (unsigned char*)"lc", (unsigned char*)entry->original_language);
 
 	/*
 	 * Add the translation informations node.
 	 */
-	translation_node=xmlNewChild(add_node, NULL, "p", entry->translation);
-	xmlSetProp(translation_node, "lc", entry->translation_language);
+	translation_node=xmlNewChild(add_node, NULL, (unsigned char*)"p", (unsigned char*)entry->translation);
+	xmlSetProp(translation_node, (unsigned char*)"lc", (unsigned char*)entry->translation_language);
 }
 
 /*
@@ -101,7 +101,7 @@
 	 * Create the main document node.
 	 */
 	main_file_node=xmlNewChild(doc->xmlRootNode, NULL,
-		"file", NULL);
+		(unsigned char*)"file", NULL);
 	g_return_if_fail(main_file_node!=NULL);
 
 	/*
@@ -113,9 +113,9 @@
 	/*
 	 * Set it's properties.
 	 */
-	xmlSetProp(main_file_node, "tool", tool_string); 
-	xmlSetProp(main_file_node, "lc", file->header->adminlang);
-	xmlSetProp(main_file_node, "datatype", file->header->datatype);
+	xmlSetProp(main_file_node, (unsigned char*)"tool",  (unsigned char*)tool_string); 
+	xmlSetProp(main_file_node,  (unsigned char*)"lc",  (unsigned char*)file->header->adminlang);
+	xmlSetProp(main_file_node,  (unsigned char*)"datatype",  (unsigned char*)file->header->datatype);
 
 	semer_utils_free(tool_string);
 }
@@ -176,7 +176,7 @@
 	/*
 	 * Create the root document, node and header node (aka. "<file>").
 	 */
-	opentag=xmlNewDoc("1.0");
+	opentag=xmlNewDoc((unsigned char*)"1.0");
 	semer_xml_set_root_node(file, opentag);
 	semer_opentag_write_header(file, opentag);
 
diff -urN ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-tmx.c ./src/semerkent/semer-tmx.c
--- ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-tmx.c	2003-01-12 12:45:01.000000000 +0100
+++ ./src/semerkent/semer-tmx.c	2004-12-23 08:54:48.322307272 +0100
@@ -66,7 +66,7 @@
 	/*
 	 * Iterate till the body tag of the TMX document.
 	 */
-	while(node && g_ascii_strcasecmp(node->name, "body"))
+	while(node && g_ascii_strcasecmp((char*)node->name, "body"))
 	{
 		node=node->next;
 	}
@@ -74,7 +74,7 @@
 	/*
 	 * The main <tu> node which holds the original & the translation.
 	 */
-	add_node=xmlNewChild(node, NULL, "tu", NULL);
+	add_node=xmlNewChild(node, NULL, (unsigned char*)"tu", NULL);
 
 	/*
 	 * Add all eventual existing properties for the <tu> from the
@@ -82,62 +82,62 @@
 	 */
 	if(SEMER_PROPS(entry->props)->id)
 	{
-		xmlSetProp(add_node, "tuid",
-			SEMER_PROPS(entry->props)->id);
+		xmlSetProp(add_node, (unsigned char*)"tuid",
+			(unsigned char*)SEMER_PROPS(entry->props)->id);
 	}
 
 	if(SEMER_PROPS(entry->props)->type)
 	{
-		xmlSetProp(add_node, "datatype", 
-			SEMER_PROPS(entry->props)->type);
+		xmlSetProp(add_node, (unsigned char*)"datatype", 
+			(unsigned char*)SEMER_PROPS(entry->props)->type);
 	}
 	else
 	{
-		xmlSetProp(add_node, "datatype", "Text");
+		xmlSetProp(add_node, (unsigned char*)"datatype", (unsigned char*)"Text");
 	}
 
 	if(SEMER_PROPS(entry->props)->changedate)
 	{
-		xmlSetProp(add_node, "changedate",
-			SEMER_PROPS(entry->props)->changedate);
+		xmlSetProp(add_node, (unsigned char*)"changedate",
+			(unsigned char*)SEMER_PROPS(entry->props)->changedate);
 	}
 
 	if(SEMER_PROPS(entry->props)->client)
 	{
 		xmlNodePtr client_node;
 
-		client_node=xmlNewChild(add_node, NULL, "prop",
-			SEMER_PROPS(entry->props)->client);
+		client_node=xmlNewChild(add_node, NULL, (unsigned char*)"prop",
+			(unsigned char*)SEMER_PROPS(entry->props)->client);
 
-		xmlSetProp(client_node, "type", "x-Client");
+		xmlSetProp(client_node, (unsigned char*)"type", (unsigned char*)"x-Client");
 	}
 
 	if(SEMER_PROPS(entry->props)->domain)
 	{
 		xmlNodePtr domain_node;
 
-		domain_node=xmlNewChild(add_node, NULL, "prop",
-			SEMER_PROPS(entry->props)->domain);
+		domain_node=xmlNewChild(add_node, NULL, (unsigned char*)"prop",
+			(unsigned char*)SEMER_PROPS(entry->props)->domain);
 
-		xmlSetProp(domain_node, "type", "x-Domain");
+		xmlSetProp(domain_node, (unsigned char*)"type", (unsigned char*)"x-Domain");
 	}
 	
 	/*
 	 * The <tuv> node with the original entries.
 	 */
-	original_node=xmlNewChild(add_node, NULL, "tuv", NULL);
-	xmlSetProp(original_node, "lang", entry->original_language);
+	original_node=xmlNewChild(add_node, NULL, (unsigned char*)"tuv", NULL);
+	xmlSetProp(original_node, (unsigned char*)"lang", (unsigned char*)entry->original_language);
 
-	content_node=xmlNewChild(original_node, NULL, "seg", entry->original);
+	content_node=xmlNewChild(original_node, NULL, (unsigned char*)"seg", (unsigned char*)entry->original);
 	
 	/*
 	 * The corresponding <tuv> node for the translated entries.
 	 */
-	translation_node=xmlNewChild(add_node, NULL, "tuv", NULL);
-	xmlSetProp(translation_node, "lang", entry->translation_language);
+	translation_node=xmlNewChild(add_node, NULL, (unsigned char*)"tuv", NULL);
+	xmlSetProp(translation_node, (unsigned char*)"lang", (unsigned char*)entry->translation_language);
 	
-	content_node=xmlNewChild(translation_node, NULL, "seg", 
-		entry->translation);
+	content_node=xmlNewChild(translation_node, NULL, (unsigned char*)"seg", 
+		(unsigned char*)entry->translation);
 }
 
 /*
@@ -150,17 +150,17 @@
 	g_return_if_fail(file!=NULL);
 	g_return_if_fail(doc!=NULL);
 
-	header=xmlNewChild(doc->xmlRootNode, NULL, "header", NULL);
-	xmlSetProp(header, "creationtool", file->header->tool);
-	xmlSetProp(header, "creationtoolsversion", file->header->tool_version);
-	xmlSetProp(header, "datatype", file->header->datatype);
-	xmlSetProp(header, "segtype", file->header->segtype);
-	xmlSetProp(header, "adminlang", file->header->adminlang);
-	xmlSetProp(header, "srclang", file->header->srclang);
-	xmlSetProp(header, "creationdate", semer_utils_tmx_date_new());
-	xmlSetProp(header, "creationid", file->header->creationid);
+	header=xmlNewChild(doc->xmlRootNode, NULL, (unsigned char*)"header", NULL);
+	xmlSetProp(header, (unsigned char*)"creationtool", (unsigned char*)file->header->tool);
+	xmlSetProp(header, (unsigned char*)"creationtoolsversion", (unsigned char*)file->header->tool_version);
+	xmlSetProp(header, (unsigned char*)"datatype", (unsigned char*)file->header->datatype);
+	xmlSetProp(header, (unsigned char*)"segtype", (unsigned char*)file->header->segtype);
+	xmlSetProp(header, (unsigned char*)"adminlang", (unsigned char*)file->header->adminlang);
+	xmlSetProp(header, (unsigned char*)"srclang", (unsigned char*)file->header->srclang);
+	xmlSetProp(header, (unsigned char*)"creationdate", (unsigned char*)semer_utils_tmx_date_new());
+	xmlSetProp(header, (unsigned char*)"creationid", (unsigned char*)file->header->creationid);
 
-	body=xmlNewChild(doc->xmlChildrenNode, NULL, "body", NULL);
+	body=xmlNewChild(doc->xmlChildrenNode, NULL, (unsigned char*)"body", NULL);
 }
 
 /*
@@ -223,7 +223,7 @@
 {
 	SemerHeader *header;
 	g_return_val_if_fail(node!=NULL, NULL);
-	g_return_val_if_fail(!g_ascii_strcasecmp(node->name, "header"), NULL);
+	g_return_val_if_fail(!g_ascii_strcasecmp((char*)node->name, "header"), NULL);
 
 	#define GET_HEADER_DATA(prop, field); \
 		if(semer_xml_get_prop(node, prop)) \
@@ -291,7 +291,7 @@
 		file->type=SEMER_TMX;
 		file->filename=g_strdup(filename);
 		
-		while(!g_ascii_strcasecmp(node->name, "header"))
+		while(!g_ascii_strcasecmp((char*)node->name, "header"))
 		{
 			file->header=semer_tmx_header_from_node(node);
 			node=node->next;
@@ -320,7 +320,7 @@
 	/*
 	 * Write the main document informations/tags.
 	 */
-	tmx=xmlNewDoc("1.0");
+	tmx=xmlNewDoc((unsigned char*)"1.0");
 	
 	semer_xml_set_root_node(file, tmx);
 	semer_tmx_write_header(file, tmx);
diff -urN ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-umtf.c ./src/semerkent/semer-umtf.c
--- ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-umtf.c	2003-01-12 12:45:01.000000000 +0100
+++ ./src/semerkent/semer-umtf.c	2004-12-23 08:56:16.353924432 +0100
@@ -46,8 +46,8 @@
 	g_return_if_fail(SEMER_FILE(file)!=NULL);
 	g_return_if_fail(doc!=NULL);
 
-	language=xmlNewChild(doc->xmlRootNode, NULL, "language", NULL);
-	xmlSetProp(language, "code", file->header->srclang);
+	language=xmlNewChild(doc->xmlRootNode, NULL, (unsigned char*)"language", NULL);
+	xmlSetProp(language, (unsigned char*)"code", (unsigned char*)file->header->srclang);
 }
 
 /*
@@ -67,15 +67,15 @@
 	/*
 	 * Iterate till our "header" part is finished.
 	 */
-	while(node && g_ascii_strcasecmp(node->name, "language"))
+	while(node && g_ascii_strcasecmp((char*)node->name, "language"))
 	{
 		node=node->next;
 	}
 
-	add_node=xmlNewChild(node, NULL, "message", NULL);
-	original_node=xmlNewChild(add_node, NULL, "value", entry->original);
-	translation_node=xmlNewChild(add_node, NULL, "translation", NULL);
-	translation_deep_node=xmlNewChild(translation_node, NULL, "value", entry->translation);
+	add_node=xmlNewChild(node, NULL, (unsigned char*)"message", NULL);
+	original_node=xmlNewChild(add_node, NULL, (unsigned char*)"value", (unsigned char*)entry->original);
+	translation_node=xmlNewChild(add_node, NULL, (unsigned char*)"translation", NULL);
+	translation_deep_node=xmlNewChild(translation_node, NULL, (unsigned char*)"value", (unsigned char*)entry->translation);
 }
 
 /*
@@ -104,7 +104,7 @@
 	/*
 	 * Create the main document for the UMTF informations.
 	 */
-	umtf=xmlNewDoc("1.0");
+	umtf=xmlNewDoc((unsigned char*)"1.0");
 	semer_xml_set_root_node(file, umtf);
 	semer_umtf_write_header(file, umtf);
 
diff -urN ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-xliff.c ./src/semerkent/semer-xliff.c
--- ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-xliff.c	2003-01-12 12:45:01.000000000 +0100
+++ ./src/semerkent/semer-xliff.c	2004-12-23 08:38:36.000000000 +0100
@@ -95,7 +95,7 @@
 	/*
 	 * Create the main document for the XLIFF informations.
 	 */
-	xliff=xmlNewDoc("1.0");
+	xliff=xmlNewDoc((unsigned char*)"1.0");
 	semer_xml_set_root_node(file, xliff);
 	semer_xliff_write_header(file, xliff);
 
diff -urN ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-xml.c ./src/semerkent/semer-xml.c
--- ../tmp-orig/gtranslator-1.1.5/src/semerkent/semer-xml.c	2003-01-12 12:45:01.000000000 +0100
+++ ./src/semerkent/semer-xml.c	2004-12-23 09:03:06.089635136 +0100
@@ -38,7 +38,7 @@
 	g_return_val_if_fail(node!=NULL, NULL);
 	g_return_val_if_fail(prop_name!=NULL, NULL);
 
-	property=xmlGetProp(node, prop_name);
+	property=(gchar*)xmlGetProp(node, (unsigned char*)prop_name);
 	
 	if(!property)
 	{
@@ -58,7 +58,7 @@
 	
 	g_return_val_if_fail(node!=NULL, NULL);
 	
-	content=xmlNodeListGetString(node->doc, node->xmlChildrenNode, 1);
+	content=(gchar*)xmlNodeListGetString(node->doc, node->xmlChildrenNode, 1);
 
 	if(!content)
 	{
@@ -85,7 +85,7 @@
 	{
 		return FALSE;
 	}
-	else if(g_ascii_strcasecmp(node->name, doctypename))
+	else if(g_ascii_strcasecmp((char*)node->name, doctypename))
 	{
 		return FALSE;
 	}
@@ -111,7 +111,7 @@
 
 	for(node=parent->xmlChildrenNode; node; node=node->next)
 	{
-		if(!xmlStrcmp(node->name, name))
+		if(!xmlStrcmp((unsigned char*)node->name, (unsigned char*)name))
 		{
 			return node;
 		}
@@ -214,7 +214,7 @@
 	/*
 	 * Set up the main document tag ("root node").
 	 */
-	node=xmlNewDocNode(doc, NULL, name, NULL);
+	node=xmlNewDocNode(doc, NULL, (unsigned char*)name, NULL);
 	xmlDocSetRootElement(doc, node);
 
 	/*
@@ -222,12 +222,12 @@
 	 */
 	if(dtd)
 	{
-		xmlNewDtd(doc, name, NULL, dtd);
+		xmlNewDtd(doc, (unsigned char*)name, NULL, (unsigned char*)dtd);
 	}
 
 	if(version)
 	{
-		xmlSetProp(node, "version", version);
+		xmlSetProp(node, (unsigned char*)"version", (unsigned char*)version);
 	}
 
 	/*