<?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>determining if a variable is defined or not</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24896/determining-if-a-variable-is-defined-or-not</link><description> 
Hi, 

 
using one simple list, located in the external sdram device, the
program is not able to figure out if the pItemNext from the list is
defined or not... Therefore I always get an data abort error. 

 
LISTITEM* pItemNext = (LITEM*)0;

/* the first</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: determining if a variable is defined or not</title><link>https://community.arm.com/thread/103602?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2009 02:02:49 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cb9cd8e6-3be8-4207-974a-04b34da59467</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
In a linked list, it is quite likely that this is not a
&lt;i&gt;&amp;quot;variable&amp;quot;&lt;/i&gt; at all; ie, not created at compile-time by the
compiler - rather, it is quite likely that this is
&lt;b&gt;&lt;i&gt;dynamically&lt;/i&gt; allocated&lt;/b&gt;.&lt;/p&gt;

&lt;p&gt;
But, yes - any pointer &lt;i&gt;&lt;b&gt;must&lt;/b&gt;&lt;/i&gt; be initialised before it
is used!!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: determining if a variable is defined or not</title><link>https://community.arm.com/thread/77909?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2009 01:41:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:1a4c2d10-0234-415e-83d0-5db89412d090</guid><dc:creator>Stefan Hartwig</dc:creator><description>&lt;p&gt;&lt;p&gt;
Hi,&lt;br /&gt;
since the variable is not initialized, its value is
unpredictable.&lt;/p&gt;

&lt;p&gt;
This also occurs, if you e.g. use integer variables:&lt;/p&gt;

&lt;pre&gt;
int i = 1;
int j;
int z;

z = i + j; // since j is not initialized, the value of z is also unpredictable
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: determining if a variable is defined or not</title><link>https://community.arm.com/thread/103591?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2009 01:39:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9ef8a516-18d8-44de-9806-f7b2ec038c25</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Very true!&lt;/p&gt;

&lt;p&gt;
On your ARM target, it happens to result in a &amp;quot;data abort error&amp;quot;;
on a PC, it could give a &amp;quot;General Protection Fault&amp;quot;; etc, etc,...&lt;/p&gt;

&lt;p&gt;
If it so happened tha the uninitialised pointer happened to point
to some &amp;quot;real&amp;quot; memory, you would get all sorts of weird &amp;amp;
wonderful bugs due to data corruption...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: determining if a variable is defined or not</title><link>https://community.arm.com/thread/90114?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2009 01:35:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4620cbd2-d756-40bf-aabe-1c47f263a474</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Of course!&lt;/p&gt;

&lt;p&gt;
Adding an element to a list (any list) &lt;i&gt;&lt;b&gt;must&lt;/b&gt;&lt;/i&gt; ensure
that the list remains entirely valid - which &lt;i&gt;&lt;b&gt;must&lt;/b&gt;&lt;/i&gt;
include ensuring that the list remains correctly terminated!&lt;/p&gt;

&lt;p&gt;
This is basic stuff - nothing specifically to do with ARM or
Keil.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: determining if a variable is defined or not</title><link>https://community.arm.com/thread/90106?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2009 01:32:38 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cae229f2-00a6-44d9-8f5b-4d1e5eab8edd</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
also pay attention to the fact that this has nothing at all to do
with C-like &amp;quot;definition&amp;quot;, just illegal memory accesses.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: determining if a variable is defined or not</title><link>https://community.arm.com/thread/57230?ContentTypeID=1</link><pubDate>Mon, 09 Nov 2009 01:30:53 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:b807b6df-3a3f-4175-a746-decc72504abb</guid><dc:creator>Tamir Michael</dc:creator><description>&lt;p&gt;&lt;p&gt;
make sure that the next element after a newly added one is a null
pointer...?&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>