<?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[Always true due ??]]></title><description><![CDATA[<p>warning: comparison is always true due to limited range of data type... kommt wenn ich:</p>
<pre><code>state[X][Y] ^= sbox_1[FILL_INDEX * 16 + add_key(X, Y)];
		if(state[X][Y] &lt; 113 &amp;&amp; state[X][Y] &gt;= 0)
			state[X][Y] += 1;
		else if(state[X][Y] &gt; 195)
			state[X][Y] -= 1;
</code></pre>
<p>generiere...</p>
<p>aber wieso?? ich sage doch nur... wenn der wert des states zwischen 0 und 112 liegt... addiere den wert 1...</p>
<p>weiß jmd warum der compiler das meldet??<br />
der state ist: unsigned char...<br />
hab mal ohne unsigned probiert... geht auch nich...<br />
thx...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/272099/always-true-due</link><generator>RSS for Node</generator><lastBuildDate>Sat, 29 Aug 2026 03:32:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/272099.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Aug 2010 12:22:40 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Always true due ?? on Tue, 10 Aug 2010 12:22:40 GMT]]></title><description><![CDATA[<p>warning: comparison is always true due to limited range of data type... kommt wenn ich:</p>
<pre><code>state[X][Y] ^= sbox_1[FILL_INDEX * 16 + add_key(X, Y)];
		if(state[X][Y] &lt; 113 &amp;&amp; state[X][Y] &gt;= 0)
			state[X][Y] += 1;
		else if(state[X][Y] &gt; 195)
			state[X][Y] -= 1;
</code></pre>
<p>generiere...</p>
<p>aber wieso?? ich sage doch nur... wenn der wert des states zwischen 0 und 112 liegt... addiere den wert 1...</p>
<p>weiß jmd warum der compiler das meldet??<br />
der state ist: unsigned char...<br />
hab mal ohne unsigned probiert... geht auch nich...<br />
thx...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1938305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1938305</guid><dc:creator><![CDATA[state12311515]]></dc:creator><pubDate>Tue, 10 Aug 2010 12:22:40 GMT</pubDate></item><item><title><![CDATA[Reply to Always true due ?? on Tue, 10 Aug 2010 12:26:12 GMT]]></title><description><![CDATA[<p>state[X][Y] ist immer &gt;= 0, da du einen unsigned char benutzt, der eben immer &gt;= 0 ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1938310</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1938310</guid><dc:creator><![CDATA[feigling]]></dc:creator><pubDate>Tue, 10 Aug 2010 12:26:12 GMT</pubDate></item><item><title><![CDATA[Reply to Always true due ?? on Tue, 10 Aug 2010 12:29:26 GMT]]></title><description><![CDATA[<p>ja.. aber es müssen doch beide vorraussetzungen erfüllt werden... also auch das es kleiner als 113 sein muss... und das kann nicht immer true sein...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1938314</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1938314</guid><dc:creator><![CDATA[state12311515]]></dc:creator><pubDate>Tue, 10 Aug 2010 12:29:26 GMT</pubDate></item><item><title><![CDATA[Reply to Always true due ?? on Tue, 10 Aug 2010 12:33:55 GMT]]></title><description><![CDATA[<p>state12311515 schrieb:</p>
<blockquote>
<p>ja.. aber es müssen doch beide vorraussetzungen erfüllt werden... also auch das es kleiner als 113 sein muss... und das kann nicht immer true sein...</p>
</blockquote>
<p>In der Warnung steht auch nur, dass der eine Vergleich immer true ist. Nicht, dass die Bedingung immer true ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1938318</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1938318</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 10 Aug 2010 12:33:55 GMT</pubDate></item></channel></rss>