navit-project.org

forum for navit navigation tool
It is currently 25 Feb 2020, 23:41
View unanswered posts | View active topics


All times are UTC


Forum rules


Feel free to ask anything here related to the development process - coding, creating new features, fixing bugs and custom changes of Navit.

Note: For reporting bugs, use the bug tracker.



Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Build navit revision 5571 or higher
PostPosted: 13 Aug 2013, 14:50 
Offline

Joined: 13 Aug 2013, 14:07
Posts: 4
Hi to all,
I tried to compile navit from source for my arm1136jf-s wince based device; everthing is fine using autotools or cmake under ubuntu 12.04 (I switched to bash from dash to compile with autotools) and navit runs well.

I noticed, however, a problem from the revision 5571 onwards; also stats.html confirms this:
download.navit-project.org/logs/navit/stats.html
the build fails for many platform complaining something wrong inside navit/xmlconfig.h.

I have not been able to fix it by myself since I do not know what the code exacly does (it is a function definition with a lot of callback). Moreover it seems the error has been detected early from the gcc parser, ("error: expected ')' before '*' token"), so it isnt a semantic error. The best I can do is:
svn merge -c -5571 .
since revision 5571 tries only to remove some warnings. I want to include the subsequent revisions since they seem to be important (especially revision 5575 "Fix buffer overflow in drawing code").

I tried to locate the error, GMarkupParseContext is a not defined typedef probably a change on support/ezxml/ezxml.h is missing from the commit. Anyway, maybe GMarkupParseContext it is unknown to the compiler when xmlconfig.h have been parsed, so I suggest to move all the definitions from xmlconfig.c to xmlconfig.h, adding an #include "ezxml.h".
It is the right way? Someone can fix the problem?

Thank you


 Profile  
 
 Post subject: Re: Build navit revision 5571 or higher
PostPosted: 13 Aug 2013, 15:04 
Offline

Joined: 23 Jun 2013, 20:15
Posts: 65
Location: Essen, Germany
Yelsma wrote:
Hi to all,
I noticed, however, a problem from the revision 5571 onwards; also stats.html confirms this:
download.navit-project.org/logs/navit/stats.html
the build fails for many platform complaining something wrong inside navit/xmlconfig.h.


Yes, sorry, that was me :-/.

I fixed loads of warnings, and in the process unfortunately broke all platforms that use the pseudo-GLib from support/glib. See http://trac.navit-project.org/ticket/1154 .

The build breaks because my fixes use GMarkupParseContext in xmlconfig.h; however this only works if the "real" GLib is used, because the code under support/glib does not have GMarkupParseContext . I'm working on a fix; I'll probably revert the problematic change today, then commit a real fix as soon as I figure one out.


 Profile  
 
 Post subject: Re: Build navit revision 5571 or higher
PostPosted: 13 Aug 2013, 15:46 
Offline

Joined: 13 Aug 2013, 14:07
Posts: 4
Ok sleske,
thank you very much for the fast answer!

Just a suggestion, I'm not familiar glib:
probably the easiest way to fix is to use a third type, eg "ParseContextPtr", in the function prototype.
ParseContextPtr could be defined as follow:

Code:
#ifdef HAVE_GLIB  //real glib
typedef GMarkupParseContext*  ParseContextPtr;
#else  //no glib support
typedef void*  ParseContextPtr;
#endif


Last edited by usul on 14 Aug 2013, 12:35, edited 1 time in total.
formating


 Profile  
 
 Post subject: Re: Build navit revision 5571 or higher
PostPosted: 13 Aug 2013, 17:29 
Offline

Joined: 09 Jul 2013, 17:41
Posts: 82
Hi!

It looks like we should better test for USE_EZXML macro, as it anyway is used to switch code between ezxml and glib parser inside xml_parse_text() of xmlconfig.c.

I would suggest to add #include "config.h" to gui_internal before all other header files (surprisingly it somehow misses it, most probably it's included from some header file), and then add following to the start of xmlconfig.h:
Code:
#ifdef USE_EZXML
#define GMarkupParseContext void
#endif


tryagain


 Profile  
 
 Post subject: Re: Build navit revision 5571 or higher
PostPosted: 13 Aug 2013, 21:55 
Offline

Joined: 13 Aug 2013, 14:07
Posts: 4
USE_EZXML is the right macro to check!
Anyway, I would prefer to define a new type.
For example, if you define GMarkupParseContext as void:
Code:
#ifdef USE_EZXML
#define GMarkupParseContext void
#endif

the following code wont compile (defining USE_EZXML):
Code:
GMarkupParseContext*context;
context->element_name;

Moreover you can't anymore declare a GMarkupParseContext object:
Code:
GMarkupParseContext context;

You can't dereference what seems to be a pointer
Code:
GMarkupParseContext*context;
*context;

in this way the definition of GMarkupParseContext is tricky!!


Defining instead a new type:
Code:
#ifdef USE_EZXML
typedef GMarkupParseContext* ParseContextPtr;
#else //no glib support
typedef void* ParseContextPtr;
#endif


it is clear that ParseContextPtr is a pointer to something depending on the underlying OS.
ParseContextPtr is always a well defined type, you can declare it anywhere.
Anyway, this is only a suggestion!!!


 Profile  
 
 Post subject: Re: Build navit revision 5571 or higher
PostPosted: 13 Aug 2013, 22:07 
Offline

Joined: 23 Jun 2013, 20:15
Posts: 65
Location: Essen, Germany
Yelsma wrote:
Just a suggestion, I'm not familiar glib:
probably the easiest way to fix is to use a third type, eg "ParseContextPtr", in the function prototype.
[...]


Actually, I think this is basically what is already done. From xmlconfig.c:

Code:
#if !USE_EZXML
  #define ATTR_DISTANCE 1
  const int xml_attr_distance=1;
  typedef GMarkupParseContext xml_context;
#else
  #include "ezxml.h"
[...]
  typedef void * xml_context;
#endif


The problem is that this is in xmlconfig.c, and not in the header file xmlconfig.h. However, I used GMarkupParseContext in the header file. I'll see if I can sort this out.


 Profile  
 
 Post subject: Re: Build navit revision 5571 or higher
PostPosted: 14 Aug 2013, 11:15 
Offline

Joined: 13 Aug 2013, 14:07
Posts: 4
Quote:
Actually, I think this is basically what is already done.


Ok, I read the source code, well, I think it is the right way.

Today I tested revision 5576 with autotools and cmake, and everything builds fine!

Thank you


 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Silver Orange 2.0.6 for IPB Designed by Skins and Hosting
Converted for phpBB3, based on Royal Blue template by BigB © 2007 2008 AEON KINGS