gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnucap-devel] waves branch and wave copy constructor


From: al davis
Subject: Re: [Gnucap-devel] waves branch and wave copy constructor
Date: Sat, 7 Mar 2015 11:14:23 -0500
User-agent: KMail/1.13.7 (Linux/3.2.0-4-amd64; KDE/4.8.4; x86_64; ; )

On Saturday 07 March 2015, Felix Salfelder wrote:
> On Sat, Mar 07, 2015 at 08:37:08AM -0500, al davis wrote:
> > using clone now .. still a problem, but I think this one
> > should be easy to fix.
> 
> in case this is about DISPATCHER()...
> 
> i did notice that there's someting wrong in case a DISPATCHER
> is created dynamically. _map lacks initialization. just
> initializing it (to NULL) breaks some magic that i do not
> understand.

Look at the unstable branch.  There is an updated dispatcher.  
This issue is not fixed there, but it explains what is 
happening.

The reason for the changes there is to have a common base for 
all dispatchers, which is necessary for the help command.  

Also, the dispatcher previously had not been formally tested, 
just informal stuff during development.  ("//testing=informal")
So I did that too, which re-exposed some issues.

The "some magic" you refer to has to do with ordering of static 
constructors.  The file "globals.cc" must be linked first, 
because dispatchers must be constructed before you can use them.  
At the time, I was not sure how to manage the link order issue.


> i have a workaround i use in output-WIP. basically it is just
> 
> +enum CC_DYNAMIC_t {CC_DYNAMIC};
> 
> and
> 
> +  DISPATCHER(CC_DYNAMIC_t) { untested();
> +    incomplete(); // missing destructor
> +    _map = new std::map<std::string, T*>;
> +  }
> 
> in l_dispatch.h.
> 
> if this looks easy to you, please fix it properly :D

Proper fix is that the simple one is the only one.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]