[Python-Dev] C99

INADA Naoki songofacandy at gmail.com
Sat Aug 6 22:36:04 EDT 2016


>>
>> * inline function
>> static inline function can be used instead of may macros.
>> It is more readable, and type safe.
>
> My experience from a few months ago with some cross-platform code is
> that clang, GCC and MSVC have different ideas about how inline
> functions in C work. Are they static or extern? Do you need provide an
> implementation body somewhere?

You're right. I think inline function should be used as "static inline" always.

Python uses "static inline" already, via "Py_LOCAL_INLINE" macro, when
USE_INLINE is defined. So using "static inline" is not problem.

If we can assume inline is usable, we can remove the macro, and use
"static inline"
more often to replace macros.


More information about the Python-Dev mailing list