11

Is in fact specific to C and C++ as the description implies, or should it be merged into ?

1

2 Answers 2

10

Given, especially in the light of LTO and C++ inline variables, function inlining and the effects of the inline keyword in C and C++ (and probably other languages from the C family, too) have become almost orthogonal, I am opposed to merging the tags.

Instead, the tag wiki should be updated to more closely reflect the meaning of the keyword. A clean up of the tag may also be needed, as it is also used for all sorts of inline elements like pictures in e-mails. That probably would not make a lot of sense as a tag. If has too many different meanings, we may want to split it; but that would be a different discussion.

Also, we should update the tag wiki of to reflect the fact that the concept is indeed not specific to C and C++.


Update: I updated the two tag wikis to reflect the suggestions from this as the top answer.

7
  • 3
    I would suggest renaming to c-inlining or similar
    – jkd
    Sep 21, 2018 at 23:13
  • @Braiam If you feel like further cleanup of the tag [inline] is required, please start a new discussion as a new question. What's being discussed here is whether [inline] and [inlining] should be merged. Your comment does not seem to address this at all.
    – Baum mit Augen Mod
    Sep 22, 2018 at 4:11
  • 5
    Currently both tags have the same description. So what is that orthogonal difference you are talking about?
    – Bergi
    Sep 22, 2018 at 9:57
  • 1
    @Bergi Historically, the inline keyword was introduced to C for the programmer to hint the compiler which functions to inline. To make that easier, inline functions were special-cased in the ODR. Today (and for quite a few years already), the optimizers ignore the inline hint as their heuristics are (usually) much better anyway. This strips the inline keyword off its original meaning, and only the ODR effects are left. In the light of this fact, new features like C++ inline variables make sense, where today's ODR meaning (rather than the original inlining meaning) becomes very clear.
    – Baum mit Augen Mod
    Sep 22, 2018 at 21:07
  • Oh, I had to look that up. But wouldn't it make more sense to tag that as [one-definition-rule] or [c-inline-keyword] or [c++-inline-keyword] or [inline-keyword]? I'm not sure whether inline is a keyword only in C/C++.
    – Bergi
    Sep 22, 2018 at 21:13
  • 1
    @Bergi It probably is not exclusive to C and C++, and for the discussion about what exactly to do with the tag [inline], input from domain experts of those other languages would be helpful. It does look like at least some cleanup would be required. However, the main point of this answer, "don't merge the tags", stands regardless.
    – Baum mit Augen Mod
    Sep 22, 2018 at 21:20
  • A lot of languages have inlining annotations. Rust and Haskell come to mind. I think the combination of [inlining] with the language tag would suffice to let readers know which inline was meant. I think that [c-inlining] would be a bad precedent, as we can make a combinatorial explosion of [language+feature] tags just because the semantics might differ somewhat in each language. Sep 23, 2018 at 12:02
4

The tag wikis are currently useless, but there is a significant distinction to be made, at least for C and C++:

  • The keyword tells the compiler what semantics you want. Notably, it prevents ODR violations if you use it right. (which is surprisingly complicated; I wrote an answer here detailing all the cases I know about)
  • The concept of refers to an effect that is only observable by inspecting the binary, or perhaps through timing.

Depending on exactly how far a language is from C, one or both of these concepts might not apply.

non-C-family tag:inline questions: 2080/2955

non-C-family tag:inlining questions: 59/102

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .