[GiNaC-devel] remove_dirac_ONE() and documentation patches
Vladimir V. Kisil
kisilv at maths.leeds.ac.uk
Thu May 23 08:44:18 CEST 2019
Dear Alexey,
I am attaching another iteration of the patch as suggested. The
exception-free method is used internally for a better protection.
Best wishes,
Vladimir
--
Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/
Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu
Software: Geometry of cycles http://moebinv.sourceforge.net/
>>>>> On Mon, 20 May 2019 18:06:38 +0400, Alexey Sheplyakov <asheplyakov at yandex.ru> said:
ASh> Hello,
ASh> 20.05.2019, 02:29, "Vladimir V. Kisil"
ASh> <kisilv at maths.leeds.ac.uk>:
>> Many thanks for the useful suggestions. I have revised my
>> patch in accordance with your first suggestion: both the old
>> and the new version are present. This patch is attached below.
ASh> This version looks better, but
>> +ex remove_dirac_ONE(const ex & e, bool *success, unsigned char
>> rl = 0, unsigned options = 0); +
ASh> it still subtly changes the meaning of
ASh> remove_dirac_ONE(e, 0, 0);
ASh> Before the patch it was remove_dirac_ONE(e, /* rl = */ 0, /*
ASh> options = */ 0), and with patch it's remove_dirac_ONE(e, /*
ASh> success = */ 0, /* rl = */ 0) which
ASh> 1) does not throw an exception on error 2) segfaults
ASh> Please change the prototype (of the non-throwing function) to
ASh> ex remove_dirac_ONE(const ex& e, bool& success, unsigned char
ASh> rl = 0, unsigned options = 0);
ASh> This way the compiler can pick the correct overload
ASh> e = remove_dirac_ONE(e, 0, 0); // OK: remove_dirac_ONE(const
ASh> ex&, unsigned char, unsigned) bool ok = false; e =
ASh> remove_dirac_ONE(e, ok, 0, 0);
>> Regarding crashes of my application the situation was solved by
>> partial substitution: I was able to avoid crashes keeping the
>> original version of GiNaC. It was enough to replace calls to
>> exception-free version of remove_dirac_ONE to in my library
>> only. Probably exceptions work fine within one library but
>> create crashes if passed between different libraries.
ASh> I don't quite understand how patching *just* remove_dirac_ONE
ASh> could possibly avoid the cross-DLL exceptions problem. See,
ASh> many (most?) GiNaC methods and functions use exceptions to
ASh> report an error. For instance, pseries::power_const throws
ASh> pole_error. Why this one is not a problem? What's special about
ASh> remove_dirac_ONE?
ASh> Best regards, Alexey
ASh> _______________________________________________ GiNaC-devel
ASh> mailing list GiNaC-devel at ginac.de
ASh> https://www.cebix.net/mailman/listinfo/ginac-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Modify-remove_dirac_ONE-to-eliminate-exceptions.patch
Type: text/x-diff
Size: 11288 bytes
Desc: remove_dirac_ONE patch
URL: <http://www.cebix.net/pipermail/ginac-devel/attachments/20190523/3b021076/attachment.bin>
More information about the GiNaC-devel
mailing list