<?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>Union</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/24719/union</link><description> 
hi 
i am programming AT89s52 in C.I am facing a problem in the program.i
have declared array in union as shown below 

 
union
{
 unsigned int uiData[100];
}s;
 
 

The problem is i have to access this array in a separate file using extern how should</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Union</title><link>https://community.arm.com/thread/114641?ContentTypeID=1</link><pubDate>Tue, 03 Feb 2009 06:52:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:07cee2ed-2f8c-480a-9696-3181197b27cf</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
As Erik highlighted, the Error message tells you explicitly what
has overflowed - it is the &lt;b&gt;DATA&lt;/b&gt; space.&lt;/p&gt;

&lt;p&gt;
It also shows you by how much you&amp;#39;ve overflowed:&lt;/p&gt;

&lt;pre&gt;
Program size : &lt;b&gt;data = 166.6&lt;/b&gt; xdata=0; code= 3917
&lt;/pre&gt;

&lt;p&gt;
You can look in the &lt;b&gt;Linker Listing&lt;/b&gt; file (or &amp;quot;Map&amp;quot; file) for
more details...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Union</title><link>https://community.arm.com/thread/102953?ContentTypeID=1</link><pubDate>Tue, 03 Feb 2009 05:37:33 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:925f6f88-c5f9-493a-be64-c85ee5665177</guid><dc:creator>erik  malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
How can i know in which part is causin overflow problem&lt;br /&gt;
the error is shown below&lt;/p&gt;

&lt;p&gt;
*** ERROR L107 : ADDRESS SPACE OVERFLOW SPACE : &lt;b&gt;DATA&lt;/b&gt;
SEGMENT _DATA_GROUP_ LENGTH 0024H&lt;br /&gt;
Program size : data = 166.6 xdata=0; code= 3917&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Union</title><link>https://community.arm.com/thread/77124?ContentTypeID=1</link><pubDate>Tue, 03 Feb 2009 01:48:13 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:52448620-bfcb-4d38-916e-5cb0429aba43</guid><dc:creator>aamir khan</dc:creator><description>&lt;p&gt;&lt;p&gt;
i am using AT89s52 it has 256 RAM .lower 128 direct access and
upper 128 through idata.How can i know in which part is causin
overflow problem&lt;br /&gt;
the error is shown below&lt;/p&gt;

&lt;pre&gt;

*** ERROR L107 : ADDRESS SPACE OVERFLOW
    SPACE : DATA
    SEGMENT _DATA_GROUP_
    LENGTH 0024H
Program size : data = 166.6 xdata=0; code= 3917
&lt;/pre&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Union</title><link>https://community.arm.com/thread/77125?ContentTypeID=1</link><pubDate>Tue, 03 Feb 2009 01:30:27 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:eaa8a680-eed2-4cdf-89de-2694de89ceae</guid><dc:creator>aamir khan</dc:creator><description>&lt;p&gt;&lt;p&gt;
the compiler does not recognize it&lt;br /&gt;
undefined Udata&lt;/p&gt;

&lt;p&gt;
i hve tried this&lt;/p&gt;

&lt;p&gt;
&lt;b&gt;extern union unsigned char array name&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
but it doesnt work&lt;/p&gt;

&lt;p&gt;
and another question why cant we declare union in idata the
compiler says it illegal operation&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Union</title><link>https://community.arm.com/thread/55318?ContentTypeID=1</link><pubDate>Tue, 03 Feb 2009 00:51:20 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:fd31af22-bddb-45e5-b602-82edbc5b0597</guid><dc:creator>ImPer Westermark</dc:creator><description>&lt;p&gt;&lt;p&gt;
I would prefer so large variables to be explicitly placed in
specific memory regions instead of just relying on the current memory
model.&lt;/p&gt;

&lt;p&gt;
You do not say why your access code doesn&amp;#39;t work - have you
remembered to include a header file so the compiler knows about the
data type and storage information for the variable?&lt;/p&gt;

&lt;p&gt;
Always remember to explicitly tell what doesn&amp;#39;t work, and any
error messages you get. Or what happens and what you did expect to
happen.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>