<?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[Do not confuse undefined behaviour with undefined result]]></title><description><![CDATA[<p>I realized that many C++ programmers have misconception about undefined behaviour, thinking of it as just «undefined result». As far as I know there is no such thing as undefined result in C++ standard; only undefined behaviour.</p>
<p>Here is good example we found during debug session. It illustrates the difference between undefined result and undefined behaviour well.</p>
<pre><code class="language-cpp">//Function specification: will return 1 for *int_ptr != 0 and 0 for *int_ptr == 0. int_ptr points to value in range 0..9.
int someFunc(int *int_ptr)
{
  //bool will take not more than 4 bytes. So, I can just point bool* to the memory location where int is stored.
  //I have heard that casting pointers is somehow undefined, but I do not really care
  //because I am clever and know that false is zero and true is not zero, and value in range 0..9
  //is just single byte, so even if bool is single byte everything will be good etc...
  bool *bool_ptr = (bool *)int_ptr;
  bool flag = *bool_ptr; //I really need boolean value, not pointer
  if(flag) return 1; //flag is true
  flag = !flag; //If it was false, after inversion it will be certainly true
  if(flag) return 0; //Will always return 0 here
}
</code></pre>
<p>The worst thing programmer expects here is that the function will return 1 instead of 0 or vice versa due to undefined result of pointer casting. But not the core dump we got! Moreover, the casting itself works successfully and even some other code after it is executed. Moreover, the core dump appears only in some cases...</p>
<p>Do you need an explanation of this case or you want to think yourselves? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/309281/do-not-confuse-undefined-behaviour-with-undefined-result</link><generator>RSS for Node</generator><lastBuildDate>Wed, 05 Aug 2026 06:30:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/309281.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Oct 2012 20:54:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Thu, 18 Oct 2012 21:08:45 GMT]]></title><description><![CDATA[<p>I realized that many C++ programmers have misconception about undefined behaviour, thinking of it as just «undefined result». As far as I know there is no such thing as undefined result in C++ standard; only undefined behaviour.</p>
<p>Here is good example we found during debug session. It illustrates the difference between undefined result and undefined behaviour well.</p>
<pre><code class="language-cpp">//Function specification: will return 1 for *int_ptr != 0 and 0 for *int_ptr == 0. int_ptr points to value in range 0..9.
int someFunc(int *int_ptr)
{
  //bool will take not more than 4 bytes. So, I can just point bool* to the memory location where int is stored.
  //I have heard that casting pointers is somehow undefined, but I do not really care
  //because I am clever and know that false is zero and true is not zero, and value in range 0..9
  //is just single byte, so even if bool is single byte everything will be good etc...
  bool *bool_ptr = (bool *)int_ptr;
  bool flag = *bool_ptr; //I really need boolean value, not pointer
  if(flag) return 1; //flag is true
  flag = !flag; //If it was false, after inversion it will be certainly true
  if(flag) return 0; //Will always return 0 here
}
</code></pre>
<p>The worst thing programmer expects here is that the function will return 1 instead of 0 or vice versa due to undefined result of pointer casting. But not the core dump we got! Moreover, the casting itself works successfully and even some other code after it is executed. Moreover, the core dump appears only in some cases...</p>
<p>Do you need an explanation of this case or you want to think yourselves? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261825</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261825</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Thu, 18 Oct 2012 21:08:45 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Thu, 18 Oct 2012 21:30:05 GMT]]></title><description><![CDATA[<p>Is this supposed to be a question? Your example yields to undefined behavior by the way. A good example where the result is not defined but the behavior is, is this:</p>
<pre><code class="language-cpp">bool is_small_endian()
{
  const int i = 1;
  return *reinterpret_cast&lt;const char*&gt;(&amp;i) != 0;
}
</code></pre>
<p>Still, I'm not really sure what you want to say..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261832</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261832</guid><dc:creator><![CDATA[cooky451]]></dc:creator><pubDate>Thu, 18 Oct 2012 21:30:05 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Thu, 18 Oct 2012 21:37:07 GMT]]></title><description><![CDATA[<p>Well, the standard actually does distinguish between undefined and unspecified behaviour. The result of the pointer conversion, for example, is unspecified, i.e., there is some result, but what it is exactly depends on the implementation. Accessing the underlying object through the cast pointer value, on the other hand, leads to undefined behaviour...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261833</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Thu, 18 Oct 2012 21:37:07 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Thu, 18 Oct 2012 21:45:58 GMT]]></title><description><![CDATA[<p>Hard to understand those strange shit. The casts in the first example looks likes pure C-code, isn't it?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261838</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261838</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Thu, 18 Oct 2012 21:45:58 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Thu, 18 Oct 2012 23:39:02 GMT]]></title><description><![CDATA[<p>Clarification:<br />
I presented syntetic example which demonstrates that pointer casting that is widely considered as undefined result (at least for built-in types) is in fact undefined behaviour (even for built-in types). Casting <code>int *</code> to <code>bool *</code> can crash. The function causes core dump at least in one system.</p>
<p>I also asked a question: can you identify a reason for crash?<br />
(I really know the reason, just want to give mind-candy for some people)</p>
<p><strong>cooky451</strong>, you example is undefined behaviour too.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261848</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261848</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Thu, 18 Oct 2012 23:39:02 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Fri, 19 Oct 2012 00:14:50 GMT]]></title><description><![CDATA[<p>SAn schrieb:</p>
<blockquote>
<p>Casting <code>int *</code> to <code>bool *</code> can crash.</p>
</blockquote>
<p>Nope, the result of casting an <code>int*</code> to a <code>bool*</code> is unspecified, but the cast itself does not lead to undefined behaviour. The standard even guarantees that casting the resulting value back to <code>int*</code> will yield the original value. (§5.2.10/7)</p>
<p>Undefined behaviour only arises, when one uses the casted pointer value to <em>access</em> the object. (§3.10/10)</p>
<p>Note that if <code>int_ptr</code> would, in fact, point to an object of type bool (i.e, it would be a <code>bool*</code> converted to an <code>int*</code> ) your sample function above would even exhibit perfectly well defined behaviour according to the standard...</p>
<p>SAn schrieb:</p>
<blockquote>
<p><strong>cooky451</strong>, you example is undefined behaviour too.</p>
</blockquote>
<p>No, in this particular case, the result is implementation defined, but there is no undefined behaviour (because he accesses the object through a <code>const char*</code> , the strict aliasing rule is not violated)...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261849</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261849</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 19 Oct 2012 00:14:50 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Fri, 19 Oct 2012 00:10:26 GMT]]></title><description><![CDATA[<p><strong>dot</strong><br />
OK, I totally agree with you.</p>
<p>I wanted to say that «casting <code>int *</code> to <code>bool *</code> and then accessing and using this bool can crash».</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261850</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Fri, 19 Oct 2012 00:10:26 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Fri, 19 Oct 2012 00:16:44 GMT]]></title><description><![CDATA[<p>SAn schrieb:</p>
<blockquote>
<p>I wanted to say that «casting <code>int *</code> to <code>bool *</code> and then accessing and using this bool can crash».</p>
</blockquote>
<p><em>If</em> the object pointed to is not actually of type <code>bool</code> , then yes.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261852</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Fri, 19 Oct 2012 00:16:44 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Fri, 19 Oct 2012 04:36:18 GMT]]></title><description><![CDATA[<p>Casting a pointer does not automatically cast the value to which it points, is that right?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261855</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Fri, 19 Oct 2012 04:36:18 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Fri, 19 Oct 2012 05:33:19 GMT]]></title><description><![CDATA[<p>Butterbrot schrieb:</p>
<blockquote>
<p>Casting a pointer does not automatically cast the value to which it points, is that right?</p>
</blockquote>
<p>All you do when casting a pointer, is changing as what the pointed adress <strong>of that new pointer</strong> should be interpreted when dereferencing <strong>that new pointer</strong>.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2261859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261859</guid><dc:creator><![CDATA[Sone]]></dc:creator><pubDate>Fri, 19 Oct 2012 05:33:19 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Fri, 19 Oct 2012 06:43:15 GMT]]></title><description><![CDATA[<p>[quote=&quot;Sone&quot;All you do when casting a pointer, is changing as what the pointed adress <strong>of that new pointer</strong> should be interpreted when dereferencing <strong>that new pointer</strong>.[/quote] And sometimes the address as well....</p>
<pre><code class="language-cpp">#include &lt;iostream&gt;
struct A {int i;};
struct B {double d;};
struct C: A, B {};

int main()
{
  C c;
  A* pa = &amp;c;
  B* pb= (B*)((C*)pa);

  std::cout &lt;&lt; (void*) pa &lt;&lt; ' ' &lt;&lt; (void*) pb &lt;&lt; '\n';
};
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2261871</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2261871</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Fri, 19 Oct 2012 06:43:15 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Sun, 21 Oct 2012 14:14:55 GMT]]></title><description><![CDATA[<p>OK, that is how my example may crash.</p>
<p>Suppose that compiler for speed reasons stores <code>false</code> as zero and <code>true</code> as one (and this is the only valid value for <code>true</code> ). So, it can use bitwise arithmetic for boolean operations.</p>
<p>If you cast <code>int</code> to <code>bool</code> then compiler will compare it to zero and assign zero or one to <code>bool</code> variable depending on comparison result.</p>
<p>The problem that this code may store invalid value (for example, 3) to boolean value, because it casts pointers, not values:</p>
<pre><code class="language-cpp">bool *bool_ptr = (bool *)int_ptr; 
bool flag = *bool_ptr;
</code></pre>
<p>The negation operator <code>!</code> may invert the last bit only, so such invalid bool value will always be non-zero independing of negations you apply to it.</p>
<p>The compiler may decide that it is better to keep <code>return</code> in <code>else</code> clause and rewrite this code:</p>
<pre><code class="language-cpp">if(flag) return 1;
flag = !flag;
if(flag) return 0;
</code></pre>
<p>in following equivalent way:</p>
<pre><code class="language-cpp">if(!flag)
{
  if(flag)
    ;
  else return 0;
} else return 1;
</code></pre>
<p>(It is better for compiler to have single action in <code>else</code> clause since it can skip it by jz/jnz assembly instruction)</p>
<p>Both <code>if</code> s will go by &quot;true&quot; branch, and function will not return anything.</p>
<p>So, reading the <code>int</code> value as <code>bool</code> value by means of pointer casting is undefined behaviour, not undefined result as one may think.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262506</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262506</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Sun, 21 Oct 2012 14:14:55 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Mon, 22 Oct 2012 01:06:27 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/17152">@SAn</a><br />
If the Standard says it's UB then it's UB and that's that.<br />
I think for the most part reasoning about why or what could possibly go wrong is contra-productive. Because it gives some people a false sense of security. They see what could go wrong, and think &quot;ah, interesting, so if I make sure that THAT cannot happen, then I'm safe&quot;. And still write code that relies on UB constructs.</p>
<blockquote>
<p>I also asked a question: can you identify a reason for crash?<br />
(I really know the reason, just want to give mind-candy for some people)</p>
</blockquote>
<p>Proves my point. You say you know THE reason. Which is utter BS. There is not &quot;the reason&quot;. Thinking about &quot;the&quot; reason is exactly what leads people to think they're smarter then the Standard. &quot;Oh, I know THE reason, so the rule in the Standard is just for stupid people, but since I'm so smart I can do this anyway.&quot;<br />
OK, wait, there is: THE reason is that the Standard says it's UB.</p>
<p>Just to give you some other examples why this could cause Bad Things (tm) to happen.<br />
It violates strict aliasing. Sincea access via the alias *bool_ptr is forbidden the compiler doesn't have to consider it, and could decide to not re-load a variable after it has been updated via *bool_ptr.<br />
And then or course there's big-endian vs. little-endian.<br />
And then there's the fact - if I didn't mention it already - that the Standard says it's UB.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2262627</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2262627</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Mon, 22 Oct 2012 01:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 11:05:46 GMT]]></title><description><![CDATA[<p><strong>hustbaer</strong>, I totally agree with you. Of course, that was just one of possible reasons. And, of course, that is UB, and we should not waste our time searching what may go wrong.</p>
<p>BUT people around me often rely on undefined behaviour, and when I say them that they should not, they answer: &quot;Hey! The code is tested. Everything works fine!&quot;. So, there is not enough for them to just say that this is UB (they really think that they are smarter than standard), so they need a prove that things may really go wrong; some crashing scenario is needed (yes, I got your point about false sense of security).</p>
<p>Such people often say me that <em>writting large programs without UB is contra-productive</em>. And they are right on their own: sometimes we can write small elegant peace of UB code instead of big, ugly, and slow standard-compliant code.</p>
<p>Here is the example. We have image consisting of pixels having positive <code>float</code> values. We need very fast classifier to segmentate eyes on image (each pixel should be processed). Algorithm uses signs of pixels differences in neighborhood as features, which are then fed to <code>if</code> statements (decision trees). We know than positive <code>float</code> s can be compared when they loaded as <code>int</code> s (pointer casting!). So, minor modification of code (casting <code>float</code> data pointer to <code>int</code> pointer) leads to 30% performance improvement! Why we should not do this if everything just works? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263176</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263176</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Tue, 23 Oct 2012 11:05:46 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 11:34:30 GMT]]></title><description><![CDATA[<p>SAn schrieb:</p>
<blockquote>
<p>Here is the example. We have image consisting of pixels having positive <code>float</code> values. We need very fast classifier to segmentate eyes on image (each pixel should be processed). Algorithm uses signs of pixels differences in neighborhood as features, which are then fed to <code>if</code> statements (decision trees). We know than positive <code>float</code> s can be compared when they loaded as <code>int</code> s (pointer casting!). So, minor modification of code (casting <code>float</code> data pointer to <code>int</code> pointer) leads to 30% performance improvement! Why we should not do this if everything just works? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
</blockquote>
<p>That is perfectly fine by the C++-Standard. It is implementation defined behavior, of course, but that is very different from undefined behavior. As long as your assumptions about the sizes of integers, floats and the internal representation of both hold, your program will work.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263185</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 23 Oct 2012 11:34:30 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 11:37:21 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>SAn schrieb:</p>
<blockquote>
<p>Here is the example. We have image consisting of pixels having positive <code>float</code> values. We need very fast classifier to segmentate eyes on image (each pixel should be processed). Algorithm uses signs of pixels differences in neighborhood as features, which are then fed to <code>if</code> statements (decision trees). We know than positive <code>float</code> s can be compared when they loaded as <code>int</code> s (pointer casting!). So, minor modification of code (casting <code>float</code> data pointer to <code>int</code> pointer) leads to 30% performance improvement! Why we should not do this if everything just works? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
</blockquote>
<p>That is perfectly fine by the C++-Standard.</p>
</blockquote>
<p>IMHO it's not, it violates the strict aliasing rule...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263186</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263186</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Tue, 23 Oct 2012 11:37:21 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 12:00:20 GMT]]></title><description><![CDATA[<p>dot schrieb:</p>
<blockquote>
<p>IMHO it's not, it violates the strict aliasing rule...</p>
</blockquote>
<p>Depends how you do it. I don't see why you must violate strict aliasing in this case (of course you <em>can</em>, if you try).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263201</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263201</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Tue, 23 Oct 2012 12:00:20 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 13:19:39 GMT]]></title><description><![CDATA[<p>Can you give me an example on how you would do this in a well defined manner? The only way I can think of is by using char pointers and probably memcpy()...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263202</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263202</guid><dc:creator><![CDATA[dot]]></dc:creator><pubDate>Tue, 23 Oct 2012 13:19:39 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 14:32:20 GMT]]></title><description><![CDATA[<p>Here is a joke I came up with:</p>
<p>— What a programmer will do if a cat came up to him on the street and asked how to go to the library?<br />
— It will be undefined behaviour.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263259</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Tue, 23 Oct 2012 14:32:20 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 22:52:03 GMT]]></title><description><![CDATA[<p>dot schrieb:</p>
<blockquote>
<p>Can you give me an example on how you would do this in a well defined manner? The only way I can think of is by using char pointers and probably memcpy()...</p>
</blockquote>
<p>+1<br />
I'd like to see that too.</p>
<p>Assuming that the float values have been accessed as floats before the &quot;int hack&quot; runs and/or will be accessed as floats afterwards. And without copying stuff of course.</p>
<p>BTW: A few weeks ago I thought about various low-level algorithms and how nice one can implement them if one ignores strict aliasing. I wish there was some kind of escape-hatch by which one can still do aliasing.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263357</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263357</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 23 Oct 2012 22:52:03 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Tue, 23 Oct 2012 22:54:08 GMT]]></title><description><![CDATA[<p>SAn schrieb:</p>
<blockquote>
<p>BUT people around me often rely on undefined behaviour, and when I say them that they should not, they answer: &quot;Hey! The code is tested. Everything works fine!&quot;.</p>
</blockquote>
<p>Yeah, know what you mean.<br />
I wish I was taller and less kindhearted. Then I could just punch them in the face. Would be so much easier.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263358</guid><dc:creator><![CDATA[hustbaer]]></dc:creator><pubDate>Tue, 23 Oct 2012 22:54:08 GMT</pubDate></item><item><title><![CDATA[Reply to Do not confuse undefined behaviour with undefined result on Wed, 24 Oct 2012 00:01:04 GMT]]></title><description><![CDATA[<p><strong>hustbaer</strong> if you was taller and less kindhearted you will be basketball player or boxer, not C++ programmer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2263370</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2263370</guid><dc:creator><![CDATA[SAn]]></dc:creator><pubDate>Wed, 24 Oct 2012 00:01:04 GMT</pubDate></item></channel></rss>