<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Problem caused by data type?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/23671/problem-caused-by-data-type</link><description> 
I am using Analog Device ADuC848, which has 4 kbyte on-chip
nonvolatile data flash. Because each page of this data memory has 4
bytes, so I define 

 
typedef struct
{
 UINT8 value;
 UCHAR unused[3];
} NVM_SingleByte_T;
 

 
I use quite a lot of NVM_SingleByte_T</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Problem caused by data type?</title><link>https://community.arm.com/thread/135668?ContentTypeID=1</link><pubDate>Fri, 06 Feb 2009 05:34:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:25a5b8a1-5f16-4ad0-b75b-3a0e2eaf9e46</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
especially if the uninitialised variable happens to be a
pointer...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem caused by data type?</title><link>https://community.arm.com/thread/125231?ContentTypeID=1</link><pubDate>Fri, 06 Feb 2009 05:27:03 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:68377120-e398-4b73-a8f4-9171802c0a7f</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;un-initialized variables can also cause issues with changes of
optimization levels.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
What a nasty &amp;quot;optimization effect&amp;quot; (NOT an optimizer error). An
uninitialized overlaid variable could have a different content at
function entry when a program is optimized.&lt;/p&gt;

&lt;p&gt;
Erik&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem caused by data type?</title><link>https://community.arm.com/thread/114652?ContentTypeID=1</link><pubDate>Thu, 05 Feb 2009 17:33:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:ebd16a78-d609-4ec0-a8e1-ed1a32d607d4</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;&lt;p&gt;
Who said the problem is in cmdhandler&lt;br /&gt;
Arrays , passing arrays, passing structs all use pointers.&lt;br /&gt;
un-initialized variables can also cause issues with changes of
optimization levels.&lt;br /&gt;
Otherwise insure the compiler is upto date.&lt;br /&gt;
Look at the asm output by the compiler.&lt;br /&gt;
Make a small project with the issue (Not a code snippet) and send it
to support&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem caused by data type?</title><link>https://community.arm.com/thread/101609?ContentTypeID=1</link><pubDate>Wed, 04 Feb 2009 13:52:35 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:22fc55d9-2cd5-4ec8-9f1c-5d845956476d</guid><dc:creator>Donghua Gu</dc:creator><description>&lt;p&gt;&lt;p&gt;
that cmdhandler is very small as you can see, only 1 line, and
there is no pointer. So I am not sure your explanation is
right...&lt;br /&gt;
plus, how come there is no problem when I am not using using
optimizer?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem caused by data type?</title><link>https://community.arm.com/thread/89545?ContentTypeID=1</link><pubDate>Wed, 04 Feb 2009 10:43:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6a769186-1ede-493d-bf26-d04ea9d5ecc9</guid><dc:creator>Neil Kurzmam</dc:creator><description>&lt;p&gt;&lt;p&gt;
If a local variable affects anything else it can be you ran out of
RAM. Or, a pointer is not correct.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Problem caused by data type?</title><link>https://community.arm.com/thread/55341?ContentTypeID=1</link><pubDate>Tue, 03 Feb 2009 15:51:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:354ecc58-c1ea-4b8e-b15c-0ba9540b5778</guid><dc:creator>Donghua Gu</dc:creator><description>&lt;p&gt;&lt;p&gt;
I found out that if I change code optimization level below
4(Register variables), I don&amp;#39;t have this problem, and at level 4 and
above, relay starts clicking.&lt;/p&gt;

&lt;p&gt;
Anyone know what Keil is doing with that optimization?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>