Page 1 of 2

I wish mikroC support specificity of inline function!

Posted: 24 Feb 2010 08:55
by freewheel
Dear MikroE's Deverlopers!

I think that I think you have one of the best IDE for PIC/dsPIC processors! But I wish your compiler support specificity of inline function, for example:

Code: Select all

inline void func(int x) {
      //Do something
}

void main()
{
      //Initializations is placed here

      func(x);
      //Do the next tasks
}
Ability of inline function was supported by C30 of Microchip and it's so good if mikroC also have it too!

Thanks in advance!

Re: I wish mikroC support specificity of inline function!

Posted: 07 Apr 2010 13:09
by anikolic
Hello,
This will be introduced at certain point in all of our compilers. We are considering this option a while, but it was not in our top priorities, and this is why it is still unimplemented. However, we are very ready and willing to introduce it as soon as possible.

Best regards,
Aleksandar

Re: I wish mikroC support specificity of inline function!

Posted: 07 Dec 2011 14:21
by Bernie_nor
anikolic wrote:Hello,
This will be introduced at certain point in all of our compilers. We are considering this option a while, but it was not in our top priorities, and this is why it is still unimplemented. However, we are very ready and willing to introduce it as soon as possible.

Best regards,
Aleksandar

Has this been implemented yet?

My code does not compile if I use the inline statement. And the help/manual gives me no hint on how to use it "correctly".

I have a few small functions I like to have inline. I'm using them in my inerrupt routines and do not want to make a function call. Since the funtions are accessing local variables in other modules I can't set them in main. Well not unless I'd like to violate the structured design I'm used to.


I'm using MikroC PRO for PIC V5.01.


Best Regards
Bernt Hustad Hembre

Re: I wish mikroC support specificity of inline function!

Posted: 08 Dec 2011 09:32
by filip
Hi,

Unfortunately, this hasn't been implemented yet, but it is present on our wish list.
Thank you for the understanding.

Regards.
Filip.

Re: I wish mikroC support specificity of inline function!

Posted: 08 Dec 2011 09:56
by Bernie_nor
filip wrote: Unfortunately, this hasn't been implemented yet, but it is present on our wish list.
What's the time frame? Next release, within half a year, a year or mayby sometime in the far future?
Wish list or Todo list?

This is a very usefull feature that has bee implemented in all other embedded C and C++ compilers I've used the last 10-12 years.

Typical you have a timer module (with it's own local variables). And on every interrupt you want something special to happen. I.e. to set a status or a flag. The status is local to the module. But because the PIC has only one (or sometimes two) interrupt service routines you have to put the service routine in one common source file.

The way I do it is by making a small ISR function and declare it as inline. This way the access to the local varables is still only within the module, whereas the function is put directly into the main ISR without the additional function call (and the time it takes to process the call).

For people who don't understand why I'd like to keep varables private: You might want to consider reading up on the subject. And you will be supprised to see how the bug-rate drops when structuring your code onto modules. This applies to hobby projects as well.

Best Regards
Bernt

Re: I wish mikroC support specificity of inline function!

Posted: 09 Dec 2011 09:12
by filip
Hi,

We should do a major revision of our compilers next year, which will include the wish list reports.

Regards,
Filip.

Re: I wish mikroC support specificity of inline function!

Posted: 08 Apr 2012 10:05
by Sy
Sorry to dig-up this old post, but I was wondering if the inline keyword is now supported as it appears in the help, however when I attempted to use it, I get errors.

Re: I wish mikroC support specificity of inline function!

Posted: 08 Apr 2012 18:38
by zristic
It's still on the wish list, waiting to be implemented.

Re: I wish mikroC support specificity of inline function!

Posted: 08 Apr 2012 21:15
by Sy
Any update on when it will be included?

Re: I wish mikroC support specificity of inline function!

Posted: 09 Apr 2012 22:33
by zristic
There are lot of libraries waiting for the free time slot.
The inlining has a workaround and as such it always has the lowest priority.

Re: I wish mikroC support specificity of inline function!

Posted: 28 Sep 2014 16:47
by Arnulf
Any ETA on this ? It's 2014 now and it would be wonderful to be able to inline function calls manually because optimizer is doing less than stellar job in many cases (call and return take more cycles and program words than inlining of that same small function would, nevermind the context saving overhead).

What is the workaround you mentioned and does it work for other languages (Pascal) too ?

Re: I wish mikroC support specificity of inline function!

Posted: 29 Sep 2014 05:47
by RobinD
Hi,

over 2 years (4 years from the first post here) went past now.
Do you have any news on the 'inline' feature in mikroc?

With this post I want to emphasize the importance of this feature for me and other users of your product!


Best regards,
Robin

Re: I wish mikroC support specificity of inline function!

Posted: 29 Sep 2014 12:33
by filip
Hi,

We are aware that this is an important feature, but unfortunately I am unable to tell you when this option is going to be implemented.
The priorities have been changed during the past years and the inline directive is still on the wish list.

Thank you for the understanding.

Regards,
Filip.

Re: I wish mikroC support specificity of inline function!

Posted: 04 Oct 2015 14:18
by HiEveryone
Any news about inline in 2015? (2016 in 3 months)

Re: I wish mikroC support specificity of inline function!

Posted: 06 Oct 2015 09:18
by filip
Hi,

Unfortunately, not at this moment.

Regards,
Filip.