<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>MQX Software SolutionsのトピックRe: possible bug with IPADDR()</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/possible-bug-with-IPADDR/m-p/297786#M9567</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you're absolutely right, we recently met this issue and added brackets. MQX 4.1.0 has still this definition, but next versions will be fixed:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13951234391789632 jive_macro_code" jivemacro_uid="_13951234391789632"&gt;
&lt;P&gt;#define IPADDR(a,b,c,d)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((((uint32_t)(a)&amp;amp;0xFF)&amp;lt;&amp;lt;24)|(((uint32_t)(b)&amp;amp;0xFF)&amp;lt;&amp;lt;16)|(((uint32_t)(c)&amp;amp;0xFF)&amp;lt;&amp;lt;8)|((uint32_t)(d)&amp;amp;0xFF))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Mar 2014 06:17:52 GMT</pubDate>
    <dc:creator>Martin_</dc:creator>
    <dc:date>2014-03-18T06:17:52Z</dc:date>
    <item>
      <title>possible bug with IPADDR()</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/possible-bug-with-IPADDR/m-p/297785#M9566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;P lang="en-US"&gt;we are using MQX Version 4.0. We have implemented network communication over UDP with RTCS. While developing our application we compared the ip address, that was returned by Sendto() with an static ip address. To enter the IP address we used the IPADDR() MACRO, that is defined in the rtcs.h as&lt;/P&gt;&lt;P lang="en-US"&gt;&lt;SPAN style="color: #7f0055; font-size: 10pt; font-family: Consolas,serif;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 10pt; font-family: Consolas,serif;"&gt; IPADDR(a,b,c,d) (((uint_32)(a)&amp;amp;0xFF)&amp;lt;&amp;lt;24)|(((uint_32)(b)&amp;amp;0xFF)&amp;lt;&amp;lt;16)|(((uint_32)(c)&amp;amp;0xFF)&amp;lt;&amp;lt;8)|((uint_32)(d)&amp;amp;0xFF)&lt;/SPAN&gt;&lt;/P&gt;&lt;P lang="en-US"&gt;During debugging we noticed, that our comparison always evaluated as true. After some investigating we noticed that there are no brackets around the IPADDR macro, so the comparison compared the ip address with the first byte of the ip address with of course evaluated as false and the connected the other bytes of the ip address with the bit wise or operator. We think that this behavior might be undesirable and think that it could be considered a bug. We wanted to inform you about it and warn other users, so they will be able to save some debugging time, when they stumble upon the same problem. We currently have no way of telling if this problem is also present in the latest version of MQX. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2014 16:24:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/possible-bug-with-IPADDR/m-p/297785#M9566</guid>
      <dc:creator>projektecarus</dc:creator>
      <dc:date>2014-03-17T16:24:57Z</dc:date>
    </item>
    <item>
      <title>Re: possible bug with IPADDR()</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/possible-bug-with-IPADDR/m-p/297786#M9567</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you're absolutely right, we recently met this issue and added brackets. MQX 4.1.0 has still this definition, but next versions will be fixed:&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13951234391789632 jive_macro_code" jivemacro_uid="_13951234391789632"&gt;
&lt;P&gt;#define IPADDR(a,b,c,d)&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((((uint32_t)(a)&amp;amp;0xFF)&amp;lt;&amp;lt;24)|(((uint32_t)(b)&amp;amp;0xFF)&amp;lt;&amp;lt;16)|(((uint32_t)(c)&amp;amp;0xFF)&amp;lt;&amp;lt;8)|((uint32_t)(d)&amp;amp;0xFF))&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for sharing !&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 06:17:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/possible-bug-with-IPADDR/m-p/297786#M9567</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2014-03-18T06:17:52Z</dc:date>
    </item>
  </channel>
</rss>

