[NO REPLY] Inlining (rev #2, 2018-1-15)

A place of insane ideas, nothing to see here.
User avatar
Site Admin
Posts: 14462
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1078 times
Been thanked: 922 times

[NO REPLY] Inlining (rev #2, 2018-1-15)

Postby Giovanni » Sun Dec 10, 2017 5:40 pm

Restrictions, amendments and extensions:

  • The inline keyword is only allowed together with static. Non-static use shall results in an error.
  • The inline keyword enforces inlining rather than suggesting it. In no case an independent instance of an inline function is generated.
  • It is not possible to take a pointer of an inline function, trying results in an error.
  • An offline keyword will be introduced that forbids inlining for that function.
  • Functions that are not inline nor offline will be handled by the compiler for inlining decision.

Code: Select all

static inline void func1(void) {
  // This will surely be inlined.

offline void func2(void) {
  // This will surely not be inlined.

Return to “Safer C”

Who is online

Users browsing this forum: No registered users and 1 guest