<?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[Überlaufwarnung - aber wieso?]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bekomme beim folgenden Sourcecode den Compilerwarnung:W8056 Überlauf in mathematischem Integer-Ausdruck</p>
<pre><code class="language-cpp">unsigned long long all_file_bitrate;
		unsigned long long sum_duration=1;
		all_file_bitrate=(((unsigned long long)4656137432/sum_duration*(unsigned long long)8))-(96*1024);
</code></pre>
<p>und zwar in Zeile 3. Ich verstehe allerdings nicht wieso, denn die unsigned long long Grenze erreiche ich doch nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Compiler ist Borland c++ builder 2006.</p>
<p>Weiß jemand wieso?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/190111/überlaufwarnung-aber-wieso</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 12:56:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/190111.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 19 Aug 2007 17:34:06 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Überlaufwarnung - aber wieso? on Sun, 19 Aug 2007 17:35:01 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich bekomme beim folgenden Sourcecode den Compilerwarnung:W8056 Überlauf in mathematischem Integer-Ausdruck</p>
<pre><code class="language-cpp">unsigned long long all_file_bitrate;
		unsigned long long sum_duration=1;
		all_file_bitrate=(((unsigned long long)4656137432/sum_duration*(unsigned long long)8))-(96*1024);
</code></pre>
<p>und zwar in Zeile 3. Ich verstehe allerdings nicht wieso, denn die unsigned long long Grenze erreiche ich doch nicht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>Compiler ist Borland c++ builder 2006.</p>
<p>Weiß jemand wieso?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347694</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347694</guid><dc:creator><![CDATA[std**Robin]]></dc:creator><pubDate>Sun, 19 Aug 2007 17:35:01 GMT</pubDate></item><item><title><![CDATA[Reply to Überlaufwarnung - aber wieso? on Sun, 19 Aug 2007 17:43:12 GMT]]></title><description><![CDATA[<p>Ja: Eine Zahl ohne Typspezifizierer ist im Quelltext zuallererst int. D.h. die Zahl wird als int interpretiert (wofür sie zu groß ist) und dann in unsigned long long umgewandelt. Da ist das Unglück aber schon passiert. Du musst die Zahl selbst als unsigned long long markieren (mittels ULL suffix):</p>
<pre><code class="language-cpp">((4656137432ULL/sum_duration*8ULL))-(96*1024)
</code></pre>
<p>BTW: long long gehört in C++ (noch) nicht zum Standard. Also mit Vorsicht geniessen und bei Anwendung eines neuen Compilers nachschauen ob der es unterstützt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347699</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347699</guid><dc:creator><![CDATA[LordJaxom]]></dc:creator><pubDate>Sun, 19 Aug 2007 17:43:12 GMT</pubDate></item><item><title><![CDATA[Reply to Überlaufwarnung - aber wieso? on Mon, 20 Aug 2007 07:49:15 GMT]]></title><description><![CDATA[<p>Ah, verstehe, vielen Dank.<br />
Ich dachte das casten würde reichen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1347899</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1347899</guid><dc:creator><![CDATA[std**Robin]]></dc:creator><pubDate>Mon, 20 Aug 2007 07:49:15 GMT</pubDate></item></channel></rss>