inline functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I tested with the below mentioned code("inline.c") to understand about
inline functions.

I explicitly instructed gcc to translate inline.c to inline.s.

Next I removed the inline keyword from inline.c and re-created the
inline.s file, but I don’t see any difference in the assembly code. Is
it correct behavior?

Could you guys point few good examples to understand the concept of inline?



#include <stdio.h>

static inline int MAX(int x, int y) { return x > y ? x : y; }

static void test1(void);


int main(void)
{
        test1();
        return 0;
}

static void test1(void)
{
        printf("MAX(2,6) = %d\n",MAX(2,6));
}


-- 
Thanks,
Sekhar

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux