Inline function
Some implementations provide a means by which to force the compiler to inline a function, usually by means of implementation-specific declaration specifiers: Indiscriminate uses of that can result in larger code (bloated executable file), minimal or no performance gain, and in some cases even a loss in performance.Regardless of the storage class, the compiler can ignore the inline qualifier and generate a function call in all C dialects and C++.Unlike in C++, there is no way to ask for an externally visible function shared among translation units to be emitted only if required.This will be the case for object files containing the code of a single unused extern inline function.However, this approach has a drawback in the opposite case: Duplicate code will be generated if the function could not be inlined in more than one translation unit.The rationale for C99, in contrast, is that it would be astonishing if using inline would have a side-effect—to always emit a non-inlined version of the function—that is contrary to what its name suggests.[6] With version 5,[5] gcc switched from gnu89 to the gnu11 dialect, effectively enabling C99 inline semantics by default.The rationale for the C++ approach is that it is the most convenient way for the programmer, since no special precautions for elimination of unreachable code must be taken and, like for ordinary functions, it makes no difference whether extern is specified or not.The inline qualifier is automatically added to a function defined as part of a class definition.[7] This matches the traditional behavior of Unix C compilers[8] for multiple non-extern definitions of uninitialized global variables.Only static inline definitions can reference identifiers with internal linkage without restrictions; those will be different objects in each translation unit.