This is a discussion on Re: C++ exceptions - KDE ; --===============0273483972== Content-Type: multipart/signed; boundary="nextPart2565646.MZqC2qALis"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart2565646.MZqC2qALis Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Vladimir Prus wrote: >1. Add "try/catch" in each of 30 slots >2. Introduce 30 new function and use heavy template magic, or macros, to ...
--===============0273483972==
Content-Type: multipart/signed;
boundary="nextPart2565646.MZqC2qALis";
protocol="application/pgp-signature";
micalg=pgp-sha1
Content-Transfer-Encoding: 7bit
--nextPart2565646.MZqC2qALis
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Vladimir Prus wrote:
>1. Add "try/catch" in each of 30 slots
>2. Introduce 30 new function and use heavy template magic, or macros, to
>call those 30 new function from slots with added try/catch.
Let me make it clear: exceptions are not to trasverse KDELibs and Qt code.=
=20
If any of your 30 slots calls a function that may throw an exception, you=20
MUST catch it in the slot.
Allowing the exception to reach the Qt signal/slot mechanism is bound to=20
fail and, quite possibly, core dump.
>An ideal solution would be to have some base KException class, and a
> signal KApplication:nException(KException&) that I can connect to for
> error reporting. But implementing that would require lots of try/catch
> inside kdelibs, so I'm not sure that's workable.
I don't think exception handling in kdelibs code is something you can=20
expect realistically. For one thing, Qt 4 has been released and it does=20
not use exceptions. So KDE Library code will probably follow suit.
That's why KDE libraries are compiled with -fno-exceptions. And, as I said=
=20
before, specific libraries and applications can turn exceptions back on,=20
if they so need it.
But let me repeat: all exceptions must be caught before KDELibs/Qt code is=
=20
run.
=2D-=20
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
5. Swa he g=C3=A9anhwearf t=C3=B3 timbran, and hwonne he c=C3=B3m, l=C3=A1!=
Unix cw=C3=A6=C3=B0 "Hello,=20
World". =C7=BCfre =C7=BDghwilc w=C3=A6s gl=C3=A6d and seo woruld w=C3=A6s f=
r=C3=A9o.
--nextPart2565646.MZqC2qALis
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQBDlHnHM/XwBW70U1gRAkB7AJ4+CdAY2q1jzetG5ghdq7h78a2fMgCfUCjb
SPzMYlJae36sq5vCx72/Bqk=
=8Pps
-----END PGP SIGNATURE-----
--nextPart2565646.MZqC2qALis--
--===============0273483972==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
--===============0273483972==--