Hacker News new | ask | show | jobs
by josemanuel 767 days ago
Are you thinking of "weak" rather than "inline"? I always thought of "inline" as a hint to the compiler -- the compiler can inline, but it may not, depending on some compiler-specific optimisation objective (execution speed, code size, ...).
2 comments

No, I am not thinking of weak; this is why “inline does not mean inline” is on the iceberg :). Although practically speaking inline is also used as a hint. But chiefly it refers to inline linkage.

I’m actually also not familiar with weak, but a quick glance suggests that it might not mean the same thing as inline. Can weak symbols be defined multiple times? EDIT: yes, according to an SO post compilers often use weak to implement inline.

You thought wrong.

Marking the symbol as weak is what inline indeed does from a technical point of view.