[Gambas-user] [Gambas Bug Tracker] Bug #992: error compiling again libxml due missing define and compat with gcc 4.7 and 4.3

bugtracker at ...3416... bugtracker at ...3416...
Mon Sep 5 17:32:39 CEST 2016


http://gambaswiki.org/bugtracker/edit?object=BUG.992&from=L21haW4-

PICCORO LENZ MCKAY reported a new bug.

Summary
-------

error compiling again libxml due missing define and compat with gcc 4.7 and 4.3

Type             : Bug
Priority         : High
Gambas version   : 3.9.90 (TRUNK)
Product          : Development Environment


Description
-----------

when compiling gb.xml module got this error that are not present 3.9.0 release:

  CXX    gb_xml_la-main.lo
  CXX    gb_xml_la-utils.lo
utils.cpp: In function ‘void XML_Format(GB_VALUE*, char*&, size_t&)’:
utils.cpp:254: error: expected `)' before ‘PRId64’
utils.cpp:254: warning: spurious trailing ‘%’ in format
utils.cpp:254: warning: too many arguments for format
make[6]: *** [gb_xml_la-utils.lo] Error 1

this are tdue the las BUG FIX change in commit 7887 about the 32bit printf format bug:

-				fprintf(stderr, "error write: %ld\n", size);
+				fprintf(stderr, "error write: %" PRId64 "\n", size);


this happend when the compiler doesn't support inttypes.h properly, means some backports (like winbuntu 12.04 LTS) could not be possible! my backports does will not possible due this change

this line must be added:

#define __STDC_FORMAT_MACROS 1

and also include after the last the 

#include <inttypes.h>

here the patch:


--- utils.cpp.old 
+++ utils.cpp 
@@ -19,6 +19,8 @@
 
 ***************************************************************************/
 
+#define __STDC_FORMAT_MACROS 1
+
 #include "utils.h"
 #include "gbinterface.h"
 #include "gb_common.h"
@@ -27,6 +29,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <memory.h>
+#include <inttypes.h>
 
 #ifdef OS_MACOSX
 void *memrchr(const char *s, int c, size_t n)








More information about the User mailing list