<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[exception handling between C and C++]]></title><description><![CDATA[<p>Moin,</p>
<p>ich habe eine C library, die im Prinzip aus nichts anderem als das hier besteht:</p>
<pre><code>void cppMethodCallBack(int functionPtr) {
    (*functionPtr) ();
}
</code></pre>
<p>Auf der C++ Seite wird die Lib eingebunden. Ich habe hierfür eine Klasse,<br />
die wiederum eine Methode ausserhalb der Klassenscopes hat:</p>
<pre><code>void raiseException() throw (std::logic_error) {
    throw std::logic_error::logic_error(&quot;blah blah..&quot;);
}
</code></pre>
<p>In der Klasse selbst wird beides verwendet:</p>
<pre><code>...
try { cppMethodCallBack(&amp;raiseException); }
catch (std::logic_error&amp; e) { /*...*/ }
catch (...) { /*...*/ }
</code></pre>
<p>Dies alles um zu testen, ob das Printip an sich funtioniert.<br />
Nun melded gcc beim kompilieren des C++ Teils das hier:</p>
<pre><code>invalid type argument of 'unary *'....
invalid conversion from 'void (*)() throw (std::logic_error)' to 'int'
</code></pre>
<p>Was ist falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/223798/exception-handling-between-c-and-c</link><generator>RSS for Node</generator><lastBuildDate>Sat, 03 Oct 2026 19:18:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/223798.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Oct 2008 08:39:52 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to exception handling between C and C++ on Wed, 01 Oct 2008 08:41:28 GMT]]></title><description><![CDATA[<p>Moin,</p>
<p>ich habe eine C library, die im Prinzip aus nichts anderem als das hier besteht:</p>
<pre><code>void cppMethodCallBack(int functionPtr) {
    (*functionPtr) ();
}
</code></pre>
<p>Auf der C++ Seite wird die Lib eingebunden. Ich habe hierfür eine Klasse,<br />
die wiederum eine Methode ausserhalb der Klassenscopes hat:</p>
<pre><code>void raiseException() throw (std::logic_error) {
    throw std::logic_error::logic_error(&quot;blah blah..&quot;);
}
</code></pre>
<p>In der Klasse selbst wird beides verwendet:</p>
<pre><code>...
try { cppMethodCallBack(&amp;raiseException); }
catch (std::logic_error&amp; e) { /*...*/ }
catch (...) { /*...*/ }
</code></pre>
<p>Dies alles um zu testen, ob das Printip an sich funtioniert.<br />
Nun melded gcc beim kompilieren des C++ Teils das hier:</p>
<pre><code>invalid type argument of 'unary *'....
invalid conversion from 'void (*)() throw (std::logic_error)' to 'int'
</code></pre>
<p>Was ist falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591285</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591285</guid><dc:creator><![CDATA[bgdn]]></dc:creator><pubDate>Wed, 01 Oct 2008 08:41:28 GMT</pubDate></item><item><title><![CDATA[Reply to exception handling between C and C++ on Wed, 01 Oct 2008 08:43:51 GMT]]></title><description><![CDATA[<p>bgdn schrieb:</p>
<blockquote>
<p>[...schwall...]<br />
Was ist falsch?</p>
</blockquote>
<p>Das eine Funktion kein int ist. Compilermeldungen lesen hilft einem da auch weiter...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591287</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591287</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Wed, 01 Oct 2008 08:43:51 GMT</pubDate></item><item><title><![CDATA[Reply to exception handling between C and C++ on Wed, 01 Oct 2008 08:46:09 GMT]]></title><description><![CDATA[<p>Tachyon schrieb:</p>
<blockquote>
<p>bgdn schrieb:</p>
<blockquote>
<p>[...schwall...]<br />
Was ist falsch?</p>
</blockquote>
<p>Das eine Funktion kein int ist. Compilermeldungen lesen hilft einem da auch weiter...</p>
</blockquote>
<p>Und was ist bitte dann ein function pointer? Das IST ein int.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591290</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591290</guid><dc:creator><![CDATA[bgdn]]></dc:creator><pubDate>Wed, 01 Oct 2008 08:46:09 GMT</pubDate></item><item><title><![CDATA[Reply to exception handling between C and C++ on Wed, 01 Oct 2008 08:48:10 GMT]]></title><description><![CDATA[<p>bgdn schrieb:</p>
<blockquote>
<p>Tachyon schrieb:</p>
<blockquote>
<p>bgdn schrieb:</p>
<blockquote>
<p>[...schwall...]<br />
Was ist falsch?</p>
</blockquote>
<p>Das eine Funktion kein int ist. Compilermeldungen lesen hilft einem da auch weiter...</p>
</blockquote>
<p>Und was ist bitte dann ein function pointer? Das IST ein int.</p>
</blockquote>
<p>Das sieht der Compiler (und der C++-Standard) wohl anders.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591293</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591293</guid><dc:creator><![CDATA[Tachyon]]></dc:creator><pubDate>Wed, 01 Oct 2008 08:48:10 GMT</pubDate></item><item><title><![CDATA[Reply to exception handling between C and C++ on Wed, 01 Oct 2008 08:50:00 GMT]]></title><description><![CDATA[<p>bgdn schrieb:</p>
<blockquote>
<p>Tachyon schrieb:</p>
<blockquote>
<p>bgdn schrieb:</p>
<blockquote>
<p>[...schwall...]<br />
Was ist falsch?</p>
</blockquote>
<p>Das eine Funktion kein int ist. Compilermeldungen lesen hilft einem da auch weiter...</p>
</blockquote>
<p>Und was ist bitte dann ein function pointer? Das IST ein int.</p>
</blockquote>
<p>Lies mal <a href="http://www.newty.de/fpt/index.html" rel="nofollow">http://www.newty.de/fpt/index.html</a> und dann sehen wir weiter, ok?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591296</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591296</guid><dc:creator><![CDATA[Shade Of Mine]]></dc:creator><pubDate>Wed, 01 Oct 2008 08:50:00 GMT</pubDate></item><item><title><![CDATA[Reply to exception handling between C and C++ on Wed, 01 Oct 2008 08:57:33 GMT]]></title><description><![CDATA[<p>Wenn immer alle Leute so glug wären.<br />
Danke für Deine &quot;Hilfe&quot; Tachyon..</p>
<p>Ich habe im C teil int functionPtr mit<br />
void (*functionPtr) () ersetz.<br />
Im C++ Teil:<br />
void (*f_ptr) () = &amp;raiseException;<br />
udn f_ptr übergeben. Scheint zu gehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591299</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591299</guid><dc:creator><![CDATA[bgdn]]></dc:creator><pubDate>Wed, 01 Oct 2008 08:57:33 GMT</pubDate></item><item><title><![CDATA[Reply to exception handling between C and C++ on Wed, 01 Oct 2008 09:05:26 GMT]]></title><description><![CDATA[<p>bgdn schrieb:</p>
<blockquote>
<p>Wenn immer alle Leute so glug wären.<br />
Danke für Deine &quot;Hilfe&quot; Tachyon...</p>
</blockquote>
<p>Die Ironie-&quot;&quot; kannst du getrost weglassen. Er hat dir in seinem ersten Post alle nötige Hilfe zukommen lassen. Dass du ihm das nicht geglaubt hast weil du von deiner falschen Annahme überzeugt warst ist ja nicht seine Schuld.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1591308</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1591308</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Wed, 01 Oct 2008 09:05:26 GMT</pubDate></item></channel></rss>