<?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>is there inline funtion in keil c51</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/14318/is-there-inline-funtion-in-keil-c51</link><description> i want to use inline function like in 
c++ language. 
how to do in keil c or it&amp;#39;s not support? 
use #define to simulate ? </description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: is there inline funtion in keil c51</title><link>https://community.arm.com/thread/37782?ContentTypeID=1</link><pubDate>Mon, 29 Oct 2001 17:04:46 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:4038eab8-2545-4d6d-b81f-7ba29ee8f0da</guid><dc:creator>Luo Xianwu</dc:creator><description>&lt;p&gt;No, there is not. sorry Sir.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there inline funtion in keil c51</title><link>https://community.arm.com/thread/85068?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2001 21:15:24 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:6995eca7-3407-4606-947e-2b22f8225e43</guid><dc:creator>Changhua Wang</dc:creator><description>&lt;p&gt;Thanks for your answer.&lt;br /&gt;
My point is readable code. for example:&lt;br /&gt;
&lt;br /&gt;
switch x {&lt;br /&gt;
case 1: f1();&lt;br /&gt;
case 2: f2();&lt;br /&gt;
.....&lt;br /&gt;
&lt;br /&gt;
it&amp;#39;s more clear than not using function.&lt;br /&gt;
&lt;br /&gt;
but i&amp;#39;m afraid to call too much level,&lt;br /&gt;
the stack memory overflow. especially in&lt;br /&gt;
interrupt function.&lt;br /&gt;
&lt;br /&gt;
Maybe I should try another programming style.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there inline funtion in keil c51</title><link>https://community.arm.com/thread/53826?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2001 09:24:50 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:bcdf1cff-7f80-439c-b387-622ad51deb21</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;I don&amp;#39;t think it goes that far, but look at Level 8, Common-Tail Merging, and Level 9, Common-Block Subroutine Packing.&lt;br /&gt;
Note that enabling an optimisation level automatically includes all the lower levels.&lt;br /&gt;
&lt;br /&gt;
(I presume your emphasis would be &amp;quot;Favour Code Size?&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
If your function is only ever called once, does it really need to be a function? &lt;br /&gt;
A function might be better for &amp;quot;style,&amp;quot; but optimisation seems to be your overriding concern? In this case, it&amp;#39;s OK to sacrifice &amp;quot;style&amp;quot; so long as it&amp;#39;s well justified and all clearly documented&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there inline funtion in keil c51</title><link>https://community.arm.com/thread/53822?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2001 05:53:08 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:7ca6ec20-c446-45de-87e3-b5ba48bac9e8</guid><dc:creator>Changhua Wang</dc:creator><description>&lt;p&gt;However, some of the optimisation options in v6.14 might help?&lt;br /&gt;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^&lt;br /&gt;
&lt;br /&gt;
Sorry, I dont know what you mean.&lt;br /&gt;
Do you mean that the compiler will&lt;br /&gt;
let functions that be called only&lt;br /&gt;
once become inline functions automatically?&lt;br /&gt;
if yes, how to set this option?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: is there inline funtion in keil c51</title><link>https://community.arm.com/thread/37775?ContentTypeID=1</link><pubDate>Mon, 20 Aug 2001 04:54:12 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:29df690a-2375-4760-9c57-cda118464a8e</guid><dc:creator>Andrew Neil</dc:creator><description>&lt;p&gt;It&amp;#39;s not supported.&lt;br /&gt;
&lt;br /&gt;
However, some of the optimisation options in v6.14 might help?&lt;br /&gt;
&lt;br /&gt;
If you do use #defines, be &lt;b&gt;&lt;i&gt;very&lt;/i&gt;&lt;/b&gt; careful about all the pitfalls - especially parenteses, side-effects, &lt;i&gt;etc&lt;/i&gt;&lt;br /&gt;
Check the discussion in K&amp;amp;R!&lt;br /&gt;
It would probably pay you to inspect the preprocessor listing carefully to ensure that you&amp;#39;re actually getting what you intended.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>