<?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>S12 / MagniV MicrocontrollersのトピックRe: value is behaving randomly</title>
    <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498425#M12245</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;it is absolutely nonsense to discuss one static array variable with two different sizes. Have you checked variables mapping and size in the map file.&lt;/P&gt;&lt;P&gt;If the variable is defined as &lt;/P&gt;&lt;P&gt;unsigned char variable[11] then it is nonsense to address variable[11]=xxx; We know that array which is defined with&amp;nbsp; this has members [0]..[10].&lt;/P&gt;&lt;P&gt;But you have also to think about qualifier extern. It does not alocate sace. It only says that there is an object of this name defined globally somewhere.&lt;/P&gt;&lt;P&gt;I really suggest to use both definitions with the same size [12]. Then you will get no warning message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW; extern only says that there is some object of the name defined globally somewhere. Because you use extern unsigned char value[11]; in the test.c file you will receive warning L1827 Symbol value has different size in the main.c.o (12 bytes) and test.c.o (11 bytes)&lt;/P&gt;&lt;P&gt;and warning&lt;/P&gt;&lt;P&gt;C1857 Acces out of range.&lt;/P&gt;&lt;P&gt;All messages are OK and in the reality there is a global array value[12] because there is a global definition of this array. If you look into debugger and you check the size of the value you will see 12 members. Also in the map file you will find 12 members.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Jan 2016 14:15:21 GMT</pubDate>
    <dc:creator>lama</dc:creator>
    <dc:date>2016-01-27T14:15:21Z</dc:date>
    <item>
      <title>value is behaving randomly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498420#M12240</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am facing a very tricky scenario. I am using s21x i have found a code as follows&lt;/P&gt;&lt;P&gt;the definition as in file1.c&lt;/P&gt;&lt;P&gt;unsigned char value[12];&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the declaration as follows&lt;/P&gt;&lt;P&gt;extern unsigned char value[11];&lt;/P&gt;&lt;P&gt;clearly both do not match and it is wrong and i am facing an issue where the value modified in file2.c as &lt;/P&gt;&lt;P&gt;value[11] = some value; is behaving randomly that is it goes to some unexpected value. specifically value[11] is behaving randomly. Since the issue is difficult to reproduce can i assume that above mismatch can be a problem. How the code will behave in above cases. Please help. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jan 2016 10:12:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498420#M12240</guid>
      <dc:creator>rahulkrishna</dc:creator>
      <dc:date>2016-01-18T10:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: value is behaving randomly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498421#M12241</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Request to give some advice.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Jan 2016 10:02:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498421#M12241</guid>
      <dc:creator>rahulkrishna</dc:creator>
      <dc:date>2016-01-19T10:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: value is behaving randomly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498422#M12242</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I do not believe the compiler was able to accept an approach you use. If you look into attachment then there is a error message presented after compilation.&lt;/P&gt;&lt;P&gt;I believe you have defined the variable "value" as a global variable. In this case there is an error message reported. However, if you create the variable "unsigned char value[12];", for example, in the main function, then it is not the same variable as variable defined in the header file but it is local variable for function main.&lt;/P&gt;&lt;P&gt;It would be good to know what you exactly doing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Jan 2016 12:20:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498422#M12242</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2016-01-20T12:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: value is behaving randomly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498423#M12243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much for the reply. I will show you the example project the way i have written. Can you please look into the project and advice me. I am getting the warning access out of range C1857. Briefly i will write the code here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;main.c&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;unsingned char value[12];&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void main(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt;testfunction();&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;test.c file&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;extern unsigned char value[11];&lt;/P&gt;&lt;P&gt;void testfunction(void)&lt;/P&gt;&lt;P&gt;{&lt;/P&gt;&lt;P&gt; value[11]=12;&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree that the way i have written the code is wrong. Please suggest me whether value[11] exists or not or the behaviour is undefined.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Jan 2016 02:47:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498423#M12243</guid>
      <dc:creator>rahulkrishna</dc:creator>
      <dc:date>2016-01-21T02:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: value is behaving randomly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498424#M12244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any help or advice??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jan 2016 10:31:24 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498424#M12244</guid>
      <dc:creator>rahulkrishna</dc:creator>
      <dc:date>2016-01-22T10:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: value is behaving randomly</title>
      <link>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498425#M12245</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;it is absolutely nonsense to discuss one static array variable with two different sizes. Have you checked variables mapping and size in the map file.&lt;/P&gt;&lt;P&gt;If the variable is defined as &lt;/P&gt;&lt;P&gt;unsigned char variable[11] then it is nonsense to address variable[11]=xxx; We know that array which is defined with&amp;nbsp; this has members [0]..[10].&lt;/P&gt;&lt;P&gt;But you have also to think about qualifier extern. It does not alocate sace. It only says that there is an object of this name defined globally somewhere.&lt;/P&gt;&lt;P&gt;I really suggest to use both definitions with the same size [12]. Then you will get no warning message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BTW; extern only says that there is some object of the name defined globally somewhere. Because you use extern unsigned char value[11]; in the test.c file you will receive warning L1827 Symbol value has different size in the main.c.o (12 bytes) and test.c.o (11 bytes)&lt;/P&gt;&lt;P&gt;and warning&lt;/P&gt;&lt;P&gt;C1857 Acces out of range.&lt;/P&gt;&lt;P&gt;All messages are OK and in the reality there is a global array value[12] because there is a global definition of this array. If you look into debugger and you check the size of the value you will see 12 members. Also in the map file you will find 12 members.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Ladislav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Jan 2016 14:15:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S12-MagniV-Microcontrollers/value-is-behaving-randomly/m-p/498425#M12245</guid>
      <dc:creator>lama</dc:creator>
      <dc:date>2016-01-27T14:15:21Z</dc:date>
    </item>
  </channel>
</rss>

