4 ms·
my point was that f() had been defined static then you can't access it from outside the translation unit it is defined in - in other words, it is "private". i
by zabzonk 9mo ago
my point was that f() had been defined static then you can't access it from outside the translation unit it is defined in - in other words, it is "private". i'm afraid i'm unclear what your point is.
- Nevermark 9mo agoBoth points are related and matter. For most purposes, not being able to access something, and being able to access something not officially in an interface, where doing so introduces an unpredictable breaking dependency, the practical result is the same: You can't (actually/sensibly) do it.
- zabzonk 9mo agoThen why not define "something" as static, which makes the compiler and linker guarantee that you can't do it?
- bigfishrunning 9mo agoWhat if I want to internally access it from multiple compilation units, but not necessarily encourage downstream users from using it? This is really common.
- yxhuvud 9mo ago`static inline` is definitely not private. See https://github.com/axboe/liburing/blob/master/src/include/liburing.h#L32 https://github.com/axboe/liburing/blob/master/src/include/li... , for a practical example.
- 1718627440 9mo agoIt's going to become private, but its part of your side of the interface, not of the other side. The ABI boundary is between that `static inline` function and the library, not between that function and your code.