Subject: CGAL users discussion list
List archive
- From: Marc Glisse <>
- To:
- Subject: Re: [cgal-discuss] set_error_handler etc. in header-only mode
- Date: Sun, 8 Dec 2019 01:29:14 +0100 (CET)
On Sat, 7 Dec 2019, Fritz Mueller wrote:
I’m having some trouble getting set_error_handler() etc. working when using the 5.0 release in its now default header-only mode.
Looking into the sources a bit, get_static_error_handler() etc. are define in header-only mode as inlines, returning references to local statics. I think this means each call could conceivably use different storage for those statics,
No. A static variable inside a function is a unique global object. It is the usual way to simulate C++17 inline variables and get singletons.
and indeed, some instrumentation indicates that this is what is happening (if I log the address of _error_handler within get_standard_error_hander(), I see multiple distinct addresses during a run of my program.
That seems very broken. I would almost suspect that you are on windows, calling the function from several DLLs...
This doesn’t seem like it is going to work correctly... Is there a plan for addressing set_error_handler() et. al. in header-only mode, as non-header-only mode is now deprecated?
We need a testcase and details about your setup so we can reproduce the issue first, as with most bugs.
--
Marc Glisse
- [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Fritz Mueller, 12/08/2019
- Re: [cgal-discuss] set_error_handler etc. in header-only mode, Marc Glisse, 12/08/2019
Archive powered by MHonArc 2.6.18.