Quantcast
Channel: MSP low-power microcontroller forum - Recent Threads
Viewing all articles
Browse latest Browse all 22733

inline function giving error in IAR

$
0
0

Hi,

I have implemented a small code to check the inline function in C. But it give the "Function undefined error " during linking stage. If I removed the inline in the function declaration than there is no error but it is not inlined properly, means the function is not copied in main instead it is calling the function. Have anyone tried as like this?

inline int add(int, int);

void main()
{
    int a = 10, b = 4, c = 0;
    c = add (a, b);
}

inline int add(int j, int k)
{
    int l = 0;
    l = j + k;
    return l;
}


Viewing all articles
Browse latest Browse all 22733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>