<?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>about error C212 in keilC51</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/38953/about-error-c212-in-keilc51</link><description> 
hi: when I compile the below code ,the keil51 emergered a error :
error C212: indirect call: parameters do not fit within registers
. 

 
source code: 

 
typedef struct NODE{ 

 
struct NODE *link; int value; 

 
}NODE; 

 
int 
compare_ints(void const</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: about error C212 in keilC51</title><link>https://community.arm.com/thread/126362?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2010 05:50:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:9e20e574-31aa-4d28-9d5b-c0a98b8f73b3</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;in other architectures, it&amp;#39;s no big deal&lt;/i&gt;&lt;br /&gt;
agreed. Ever so often we see that the &amp;quot;architecture ignorance&amp;quot;, which
for the PC is not a big deal, carries a heavy penalty in the smaller
micros.&lt;/p&gt;

&lt;p&gt;
it&amp;#39;s been a while, but here it is again&lt;/p&gt;

&lt;p&gt;
The &amp;#39;51 aint no PC&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: about error C212 in keilC51</title><link>https://community.arm.com/thread/119058?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2010 04:39:45 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cb4c498d-2f41-4044-9a0c-9a9ae29e3bbc</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
In fact, writing &lt;i&gt;anything&lt;/i&gt; in &amp;#39;C&amp;#39; is a &amp;quot;convenience
feature&amp;quot;!&lt;/p&gt;

&lt;p&gt;
Function pointers are &amp;quot;inconvenient&amp;quot; to the 8051 architecture
because of the nature of the 8051 architecture; in other
architectures, it&amp;#39;s no big deal - there is no (significant) penalty
and, therefore, no reason &lt;i&gt;not&lt;/i&gt; to take advantage of their
convenience!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about error C212 in keilC51</title><link>https://community.arm.com/thread/104203?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2010 04:02:28 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:0e7c724c-9d4b-4bfb-962b-096ef5eda291</guid><dc:creator>&amp;#178;erik malund</dc:creator><description>&lt;p&gt;&lt;p&gt;
it is very well said previously in this thread&lt;br /&gt;
&lt;i&gt;Basically, the 8051 is not &amp;quot;just another processor&amp;quot; that you can
program as you would a PC, etc.&lt;/i&gt;&lt;br /&gt;
if you want to code for the &amp;#39;51 you WILL have to code &amp;quot;&amp;#39;51 C&amp;quot; not
&amp;quot;C&amp;quot;&lt;/p&gt;

&lt;p&gt;
I would state the above reoly this way&lt;br /&gt;
&lt;i&gt;consider whether the fight is really worth it, or a different
&lt;b&gt;software&lt;/b&gt; architecture would be more appropriate.&lt;/i&gt;&lt;br /&gt;
Function pointers, for all practical purposes is a &amp;quot;convenience
feature&amp;quot;.&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: about error C212 in keilC51</title><link>https://community.arm.com/thread/90592?ContentTypeID=1</link><pubDate>Wed, 01 Sep 2010 00:04:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:aa9e2f61-5cd6-427f-8ab2-f862e588dbcf</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
But do note that this will have a (significant) impact on
performance.&lt;/p&gt;

&lt;p&gt;
Again, you are fighting the specific features of the architecture
here - consider whether the fight is really worth it, or a different
architecture would be more appropriate...&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about error C212 in keilC51</title><link>https://community.arm.com/thread/58606?ContentTypeID=1</link><pubDate>Tue, 31 Aug 2010 23:25:31 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:cbd82e48-b471-4b1f-8e72-1b8deac85190</guid><dc:creator>J. Chrisoph</dc:creator><description>&lt;p&gt;&lt;p&gt;
Answer can be found quite easy: &lt;a href="http://www.keil.com/support/docs/2066.htm"&gt;http://www.keil.com/support/docs/2066.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
So add reentrant to the function pointer definition:&lt;/p&gt;

&lt;p&gt;
NODE * search_list (NODE *node, void const *value,
int(*compare)(void const *,void const *) reentrant)&lt;/p&gt;

&lt;p&gt;
And, by the way, never! exit your main() function!&lt;br /&gt;
Use a while(1) loop, or similar thing.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: about error C212 in keilC51</title><link>https://community.arm.com/thread/65835?ContentTypeID=1</link><pubDate>Tue, 31 Aug 2010 22:47:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:d940b2aa-d7d7-4a20-9ea8-ec90c0155281</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;p&gt;
Keil C51 has major issues with using &lt;b&gt;function pointers:&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/appnotes/docs/apnt_129.asp"&gt;http://www.keil.com/appnotes/docs/apnt_129.asp&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/support/search.asp?SA=8051&amp;amp;KW=&amp;amp;DY=&amp;amp;PL=&amp;amp;Q=function+pointer&amp;amp;KB=ON&amp;amp;PM=ON&amp;amp;PG=1&amp;amp;PX=1&amp;amp;AV=ON"&gt;
&lt;a href="http://www.keil.com/support/search.asp?SA=8051&amp;amp;KW=&amp;amp;DY=&amp;amp;PL=&amp;amp;Q=function+pointer&amp;amp;KB=ON&amp;amp;PM=ON&amp;amp;PG=1&amp;amp;PX=1&amp;amp;AV=ON"&gt;www.keil.com/.../search.asp&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
Basically, the 8051 is not &amp;quot;just another processor&amp;quot; that you can
program as you would a PC, etc.&lt;/p&gt;

&lt;p&gt;
The 8051 architecture has some very specific optimisations that
make it very good for some things, and very poor for others - and
function pointer is one of those things to which it is
&lt;i&gt;&lt;b&gt;not&lt;/b&gt;&lt;/i&gt; well suited!&lt;/p&gt;

&lt;p&gt;
If function pointers really are essential to your application,
then you should probably not be using an 8051 - at the very least,
you need to study the issues very carefully!&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>