<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-5400308.post114388500726274552..comments</id><updated>2009-12-30T18:25:57.892-05:00</updated><title type='text'>Comments on McEs, A Hacker Life: Throwing Exceptions with POSIX/ISO C</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://mces.blogspot.com/feeds/114388500726274552/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html'/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5400308.post-114965041153659134</id><published>2006-06-06T23:20:00.000-04:00</published><updated>2006-06-06T23:20:00.000-04:00</updated><title type='text'>See also the C exceptions that were part of DEC's ...</title><content type='html'>See also the C exceptions that were part of DEC's (and I think also HP's) DCE pthreads.  The package name was CMA (Common Multithread Architecture).&lt;BR/&gt;&lt;BR/&gt;There's a lot of serious quality prior art here.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114965041153659134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114965041153659134'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1149650400000#c114965041153659134' title=''/><author><name>David Arnold</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114390390824924177</id><published>2006-04-01T10:05:00.000-05:00</published><updated>2006-04-01T10:05:00.000-05:00</updated><title type='text'>You may also want to check out David Turnerspaper ...</title><content type='html'>You may also want to check out David Turners&lt;BR/&gt;paper on exception handling in C:&lt;BR/&gt;http://turnerdavid.neuf.fr/papers/reliable-c.html</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114390390824924177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114390390824924177'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143903900000#c114390390824924177' title=''/><author><name>Matthias Clasen</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114389757086643773</id><published>2006-04-01T08:19:00.000-05:00</published><updated>2006-04-01T08:19:00.000-05:00</updated><title type='text'>Haven't you seen CEXCEPT, Behdad?http://cexcept.so...</title><content type='html'>Haven't you seen CEXCEPT, Behdad?&lt;BR/&gt;&lt;BR/&gt;http://cexcept.sourceforge.net/</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389757086643773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389757086643773'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143897540000#c114389757086643773' title=''/><author><name>Paul Boddie</name><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114389674087098869</id><published>2006-04-01T08:05:00.000-05:00</published><updated>2006-04-01T08:05:00.000-05:00</updated><title type='text'>Nice work behdad, but I can't stop making a few co...</title><content type='html'>Nice work behdad, but I can't stop making a few comments:&lt;BR/&gt;&lt;BR/&gt;first of all, why not add a cleanup stack to this scheme to avoid leaking memory and resources when an exception is thrown ?. Yes, of course, this is a shameless plug to &lt;A HREF="http://turnerdavid.neuf.fr/papers/reliable-c.html" REL="nofollow"&gt;my paper on the subject&lt;/A&gt; :-)&lt;BR/&gt;&lt;BR/&gt;second, the implementation doesn't work in multi-threaded contexts. I assume that you know that, but the "global" values in the implementation should really be thread-local.&lt;BR/&gt;&lt;BR/&gt;finally, I have a bit of experience with using such a scheme in real (i.e. big and complex) code, even though it's not something I'm going to release. All I can say is that your *biggest* issue is that developers *will* constantly need to know wether a function might throw or not.&lt;BR/&gt;&lt;BR/&gt;Iv tried many schemes, and now believe that the simplest way to do that is to use a naming convention (e.g. like the one used in EPOC). Personally, I use a capital X at the end of any function that may throw, as in:&lt;BR/&gt;&lt;BR/&gt;g_mallocX, g_array_appendX, etc...&lt;BR/&gt;&lt;BR/&gt;same goes with callback type declarations, and macros (suffixed with _X, as in G_DO_STUFF_X)&lt;BR/&gt;&lt;BR/&gt;it doesn't look very nice at first, but it's something you'll get used to very quickly, and it beats having to read the documentation everytime you're unsure about what a given function does (which means every 5 minutes, if you're like me).&lt;BR/&gt;&lt;BR/&gt;Hope this helps.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389674087098869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389674087098869'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143896700000#c114389674087098869' title=''/><author><name>david turner</name><uri>http://www.freetype.org</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114389300331359513</id><published>2006-04-01T07:03:00.000-05:00</published><updated>2006-04-01T07:03:00.000-05:00</updated><title type='text'>Ok, added a simple g_finally support.  It works as...</title><content type='html'>Ok, added a simple g_finally support.  It works as try..finally, and also as try..catch..finally as long as you don't raise or throw in the catch blocks.  The linked code is the latest version.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389300331359513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389300331359513'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143892980000#c114389300331359513' title=''/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='04900605915708655800'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114389195962489976</id><published>2006-04-01T06:45:00.000-05:00</published><updated>2006-04-01T06:45:00.000-05:00</updated><title type='text'>I thought about it too.  A try..finally is trivial...</title><content type='html'>I thought about it too.  A try..finally is trivial.  try..catch..finally gets hard in the case that you raise or throw in your catch block.  It's not impossible, you just need to set another try around the catch blocks to trap throws and run the finally block.  Will look into it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389195962489976'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389195962489976'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143891900000#c114389195962489976' title=''/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='04900605915708655800'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114389176078983915</id><published>2006-04-01T06:42:00.000-05:00</published><updated>2006-04-01T06:42:00.000-05:00</updated><title type='text'>Will there be a try..finally construct too?(or eve...</title><content type='html'>Will there be a try..finally construct too?&lt;BR/&gt;&lt;BR/&gt;(or even better a try..catch..finally block like c# does)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389176078983915'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114389176078983915'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143891720000#c114389176078983915' title=''/><author><name>Jamie McCracken</name><uri>http://www.advogato.org/person/jamiemcc/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114388825245501290</id><published>2006-04-01T05:44:00.000-05:00</published><updated>2006-04-01T05:44:00.000-05:00</updated><title type='text'>This is awesome stuff, we need more of these GNOME...</title><content type='html'>This is awesome stuff, we need more of these GNOME recipes on a centralized place, so new (and old) GNOME developers can learn the good habits from there.&lt;BR/&gt;&lt;BR/&gt;Great work and keep them coming Behdad!</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114388825245501290'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114388825245501290'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143888240000#c114388825245501290' title=''/><author><name>Ruben Vermeersch</name><uri>http://www.blogger.com/profile/01513615280542736189</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114388773891089295</id><published>2006-04-01T05:35:00.000-05:00</published><updated>2006-04-01T05:35:00.000-05:00</updated><title type='text'>Since core glib doesn't throw any exceptions, it's...</title><content type='html'>Since core glib doesn't throw any exceptions, it's up to application code to make sure the exceptions are correctly handled.  The pygtk glue can for example do a g_try when passing control to native code and upon catching an exception, raise a similar Python exception, yes.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114388773891089295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114388773891089295'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143887700000#c114388773891089295' title=''/><author><name>behdad</name><uri>http://www.blogger.com/profile/15683613908300939375</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='04900605915708655800'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry><entry><id>tag:blogger.com,1999:blog-5400308.post-114388703972569119</id><published>2006-04-01T05:23:00.000-05:00</published><updated>2006-04-01T05:23:00.000-05:00</updated><title type='text'>Great Stuff - we reallt need stuff like this to im...</title><content type='html'>Great Stuff - we reallt need stuff like this to improve the quality and robustness of our c code.&lt;BR/&gt;&lt;BR/&gt;One potential showstopper is - is it compatible with high level languages? (IE if I call a gobject in say python or mono and it generates an exception, will they be able to handle it natively?</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114388703972569119'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5400308/114388500726274552/comments/default/114388703972569119'/><link rel='alternate' type='text/html' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html?showComment=1143886980000#c114388703972569119' title=''/><author><name>Jamie McCracken</name><uri>http://www.advogato.org/person/jamiemcc/</uri><email>noreply@blogger.com</email></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://mces.blogspot.com/2006/04/throwing-exceptions-with-posixiso-c.html' ref='tag:blogger.com,1999:blog-5400308.post-114388500726274552' source='http://www.blogger.com/feeds/5400308/posts/default/114388500726274552' type='text/html'/></entry></feed>