Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 C 中,如果我将函数标记为inline,并且编译器决定内联调用,那么来自该函数的所有函数调用是否也会内联?
inline
在 C 中,如果我将一个函数标记为内联,并且编译器决定内联调用,那么来自该函数的所有函数调用是否也会内联?
不必要。内联函数只是内联该函数体(如果编译器“同意”这样做) - 被调用的函数可能会被内联,但可能不会,这取决于它们的定义等。