Pablo Galindo Salgado <pablog...@gmail.com> added the comment:

I agree we should be careful here. There are several things to consider:

* Macros transformed into function may or may not get inlined so there is a 
risk of affecting performance if we just transform them in bulk.

* Because the macro is defined as 'static inline' in the header file, then it 
*can* be inlined everywhere if the compiled decides to do it. It will be one 
copy symbol in the text segment on every compilation unit. Notice that 'inline' 
has a special meaning in C99 and it doesn't only mean "inline this function". 
It has visibility implications (see section 6.7.4 of the C99 standard).

* There is risk to introducing a backwards-incompatible ABI change by mistake 
as Victor mentions.

* This can affect also the link patterns of extension modules because these 
symbols may be visible in the resulting binaries when they were 
macro-level-inlined before. I cannot see any problem that can happen because of 
this but we should carefully consider it.

In short, there is the value of converting these macros for extra type safety, 
but we need to at the very least be very careful and if we decide to go forward 
this needs as many reviews as possible so we don't miss anything. I would 
recommend maybe start a thread about this in python-dev.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43502>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to