<?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>the func pointer used in the keil.</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/33551/the-func-pointer-used-in-the-keil</link><description> Dear all, 
 
Who can help me the following question. 
 
I had wrote three routine,such as: 
 
void p1(void) 
{ 
 printf(&amp;quot;1!\n&amp;quot;); 
} 
 
void p2(void) 
{ 
 printf(&amp;quot;2!\n&amp;quot;); 
} 
 
void p3(void) 
{ 
 printf(&amp;quot;3!\n&amp;quot;); 
} 
 
than I new a pointer and a func arrary</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: the func pointer used in the keil.</title><link>https://community.arm.com/thread/95596?ContentTypeID=1</link><pubDate>Mon, 30 Jun 2003 11:52:55 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:378eadc3-7d17-4a9a-b721-d7ee5d195e41</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;There is an important App Note that you need to read, and several knowledgebase articles - use the &amp;#39;&lt;b&gt;Search&lt;/b&gt;&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the func pointer used in the keil.</title><link>https://community.arm.com/thread/71598?ContentTypeID=1</link><pubDate>Mon, 30 Jun 2003 10:09:22 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:daf045b6-a219-44e5-bf8c-00ee88add739</guid><dc:creator>HansBernhard Broeker</dc:creator><description>&lt;p&gt;Because of the way the 8051 works, function pointers are very hard to get working correctly without manually helping the compiler to use them.&lt;br /&gt;
&lt;br /&gt;
In particular, you&amp;#39;ll have to assist the call graph analysis with finding potential calls through function pointers.  I guess your second code version worked because the call graph analysis by the compiler did recognize cFunc[i] as a call through one of the function pointers in cFunc[], but not the obfuscated version of writing the same thing, (*(cFunc + i)).&lt;br /&gt;
&lt;br /&gt;
Make sure you consult the &lt;b&gt;Manual&lt;/b&gt; for pecularities with function pointers, too.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: the func pointer used in the keil.</title><link>https://community.arm.com/thread/40479?ContentTypeID=1</link><pubDate>Mon, 30 Jun 2003 03:16:37 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6ce6e1c2-5681-4029-a270-a836c56caaef</guid><dc:creator>paddy wang</dc:creator><description>&lt;p&gt;It&amp;#39;s very strange,I had tried the following,All is right.&lt;br /&gt;
&lt;br /&gt;
         while(1)&lt;br /&gt;
         {&lt;br /&gt;
&lt;br /&gt;
            unsigned char i;&lt;br /&gt;
            for( i = 0 ; i &amp;lt; 3 ; i++)&lt;br /&gt;
	      //(*(cFunc+i))();&lt;br /&gt;
		  cFunc[i]();&lt;br /&gt;
         }&lt;br /&gt;
why I cann&amp;#39;t use the pointer but only a func array?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>