Hi,
What is the difference between "inline" and "inline"?
I have programs with both. "inline" works, "inline" has an error "Unable to resolve identifier inline"

thanks

Recommended Answers

All 9 Replies

Sorry, the first inline didn't let me post double underscores before and after as with the fourth and fifth inline.

Is this what you mean?

no, __inline__

I would also like to add __always_inline__ to this.

might be gcc extension

I read those whole things and still don't understand. Sorry.

It's really not all that difficult - the standard inline keyword is SUGGESTION to the compiler to duplicate the function contents each time it appears in the program -- the compiler can coose to ignore inline if it wants to. The gcc extension _always_inline causes thee gcc to duplicate the function all the time, whether optimizing the program or not.

Thank you. Now what's the difference between inline and __inline__?
inline works, __inline__ has an error. I don't really want to be removing the underscores without knowing what they're doing.

The way I understand it, __inline__is an older version of the inline keyword -- it was an extension to some compilers. It's pretty much obolete nowdays except for older c89 compilers (link).

Thank you very much Ancient Dragon! That explains a lot.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.