<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	
	>
<channel>
	<title>
	「try{} catch(&#8230;){}」的评论	</title>
	<atom:link href="https://doyj.com/2006/09/11/try-catch/feed/" rel="self" type="application/rss+xml" />
	<link>https://doyj.com/2006/09/11/try-catch/</link>
	<description>Laputa - 远方地平线，闪耀着光芒</description>
	<lastBuildDate>Thu, 11 Sep 2014 06:16:14 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.7.2</generator>
	<item>
		<title>
		评论者：my3439955		</title>
		<link>https://doyj.com/2006/09/11/try-catch/comment-page-1/#comment-20352</link>

		<dc:creator><![CDATA[my3439955]]></dc:creator>
		<pubDate>Thu, 11 Sep 2014 06:16:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.doyj.com/2006/09/11/try-catch/#comment-20352</guid>

					<description><![CDATA[之前用vc9测试的。我用vc6又测试了一下，果然如楼主所说。]]></description>
			<content:encoded><![CDATA[<p>之前用vc9测试的。我用vc6又测试了一下，果然如楼主所说。</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：my3439955		</title>
		<link>https://doyj.com/2006/09/11/try-catch/comment-page-1/#comment-20351</link>

		<dc:creator><![CDATA[my3439955]]></dc:creator>
		<pubDate>Thu, 11 Sep 2014 06:11:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.doyj.com/2006/09/11/try-catch/#comment-20351</guid>

					<description><![CDATA[非法的内存访问属于Win32异常范畴，C++语言的try catch根本就不会去处理这种异常，也没有这种能力。

Release也不会那样去优化，可以做如下代码验证：
    try
    {
        *(int *)NULL = 11;
        throw 111;
    }
    catch (...)
    {
        cerr&#060;&#060;&#034;excetion&#034;&#060;&#060;endl;
    }
这里是有throw的，Release不会优化掉了，但是仍旧崩溃。

这段代码在Debug下也崩溃，博主能捕获到异常可能是因为那个地址真的就可写。最好直接用地址0来做测试。]]></description>
			<content:encoded><![CDATA[<p>非法的内存访问属于Win32异常范畴，C++语言的try catch根本就不会去处理这种异常，也没有这种能力。</p>
<p>Release也不会那样去优化，可以做如下代码验证：<br />
    try<br />
    {<br />
        *(int *)NULL = 11;<br />
        throw 111;<br />
    }<br />
    catch (&#8230;)<br />
    {<br />
        cerr&lt;&lt;&quot;excetion&quot;&lt;&lt;endl;<br />
    }<br />
这里是有throw的，Release不会优化掉了，但是仍旧崩溃。</p>
<p>这段代码在Debug下也崩溃，博主能捕获到异常可能是因为那个地址真的就可写。最好直接用地址0来做测试。</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：tenlywu		</title>
		<link>https://doyj.com/2006/09/11/try-catch/comment-page-1/#comment-8881</link>

		<dc:creator><![CDATA[tenlywu]]></dc:creator>
		<pubDate>Sun, 12 Apr 2009 16:12:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.doyj.com/2006/09/11/try-catch/#comment-8881</guid>

					<description><![CDATA[刚好写GA代码文章的时候，提到了try catch]]></description>
			<content:encoded><![CDATA[<p>刚好写GA代码文章的时候，提到了try catch</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：hanbger		</title>
		<link>https://doyj.com/2006/09/11/try-catch/comment-page-1/#comment-1659</link>

		<dc:creator><![CDATA[hanbger]]></dc:creator>
		<pubDate>Sun, 08 Apr 2007 18:26:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.doyj.com/2006/09/11/try-catch/#comment-1659</guid>

					<description><![CDATA[:em21:  good example~~~]]></description>
			<content:encoded><![CDATA[<p>:em21:  good example~~~</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：空心人		</title>
		<link>https://doyj.com/2006/09/11/try-catch/comment-page-1/#comment-42</link>

		<dc:creator><![CDATA[空心人]]></dc:creator>
		<pubDate>Wed, 13 Sep 2006 05:24:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.doyj.com/2006/09/11/try-catch/#comment-42</guid>

					<description><![CDATA[以前曾有过这个的疑问，赶紧在Linux上试了一下，Segment fault之后也不能被catch住。到网上查了一下，要想catch住这种系统信号，可以在信号处理函数中加上throw语句，并且在用g++编译时，加上non-call-exceptions
&lt;code&gt;
Since processor exceptions may occur anywhere in the code, the stack un-
winding libraries must be prepared to handle exceptions within any context.
This functionality is enabled by a special GNU g++ compiler °ag, \-fnon-call-
exceptions&quot;. Without the use of this °ag, only explicitly thrown exceptions are
handled. This option is typically used from user-space code that attempts to
throw exceptions from signal handlers. In the kernel, this allows an exception to
be correctly dispatched even in the absence of an explicit throw call.
&lt;/code&gt;]]></description>
			<content:encoded><![CDATA[<p>以前曾有过这个的疑问，赶紧在Linux上试了一下，Segment fault之后也不能被catch住。到网上查了一下，要想catch住这种系统信号，可以在信号处理函数中加上throw语句，并且在用g++编译时，加上non-call-exceptions<br />
<code><br />
Since processor exceptions may occur anywhere in the code, the stack un-<br />
winding libraries must be prepared to handle exceptions within any context.<br />
This functionality is enabled by a special GNU g++ compiler °ag, \-fnon-call-<br />
exceptions". Without the use of this °ag, only explicitly thrown exceptions are<br />
handled. This option is typically used from user-space code that attempts to<br />
throw exceptions from signal handlers. In the kernel, this allows an exception to<br />
be correctly dispatched even in the absence of an explicit throw call.<br />
</code></p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
