<?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>topic Re: MQX 4.2.0 _io_write vs const data in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983822#M18356</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruby:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your feedback. Yes, this is an issue. and it is fixed in MQX v5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your can fixed it by yourself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;For MQX v5 we did a full clean up of the code and we made things more consitent and up to date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 05 Feb 2020 23:55:18 GMT</pubDate>
    <dc:creator>danielchen</dc:creator>
    <dc:date>2020-02-05T23:55:18Z</dc:date>
    <item>
      <title>MQX 4.2.0 _io_write vs const data</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983821#M18355</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;/P&gt;&lt;P&gt;We are using MQX 4.2.0 and I was quite surprised that _io_write is defined to take a non-const buffer for the data:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;extern _mqx_int&amp;nbsp;&amp;nbsp;&amp;nbsp; _io_write(MQX_FILE_PTR, void *, _mqx_int);&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would have expected the second parameter to be something like &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;const void*&lt;/SPAN&gt;, furthermore that it is used in the inline definition of &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;fwrite&lt;/SPAN&gt;:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new, courier, monospace;"&gt;#define&amp;nbsp; fwrite(ptr,so,no,f) (_io_write(f,ptr,(so)*(no))/(so))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is: is it safe to assume that neither &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;fwrite&lt;/SPAN&gt; nor &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_io_write&lt;/SPAN&gt; will modify the pointer that is given to them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can there be a problem to remove the const (using a cast) of an array we want to write using &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;fwrite&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Feb 2020 22:37:41 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983821#M18355</guid>
      <dc:creator>rvigneault</dc:creator>
      <dc:date>2020-02-04T22:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.2.0 _io_write vs const data</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983822#M18356</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ruby:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your feedback. Yes, this is an issue. and it is fixed in MQX v5.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your can fixed it by yourself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;For MQX v5 we did a full clean up of the code and we made things more consitent and up to date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Feb 2020 23:55:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983822#M18356</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2020-02-05T23:55:18Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.2.0 _io_write vs const data</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983823#M18357</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to be clear, the issue here is only that the parameter is not declared as &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;const&lt;/SPAN&gt;?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean, it is used as &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;const&lt;/SPAN&gt; (i.e. not modified) by the &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_io_write&lt;/SPAN&gt; implementation right?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If so, I guess that &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;_strnlen&lt;/SPAN&gt; is the same (i.e. the first parameter is not modified and can be considered as &lt;SPAN style="font-family: courier new, courier, monospace;"&gt;const char*&lt;/SPAN&gt;). I stumbled upon it yesterday after my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2020 14:34:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983823#M18357</guid>
      <dc:creator>rvigneault</dc:creator>
      <dc:date>2020-02-06T14:34:32Z</dc:date>
    </item>
    <item>
      <title>Re: MQX 4.2.0 _io_write vs const data</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983824#M18358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, you are right.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Feb 2020 03:05:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/MQX-4-2-0-io-write-vs-const-data/m-p/983824#M18358</guid>
      <dc:creator>danielchen</dc:creator>
      <dc:date>2020-02-07T03:05:59Z</dc:date>
    </item>
  </channel>
</rss>

