Florin Papa added the comment:

Hi Stefan,

> Yes, I dislike that, too.  The question is why gcc has supported
> the "struct hack" for more than 20 years but needs an annotation
> just for MPX.
The "struct hack" represents a problem for MPX because it intentionally exceeds 
the bounds of the array declared inside in order to support a variable sized 
structure. Without the Py_VARIABLE_SIZE annotation, MPX will generate a bounds 
violation when accessing outside the declared size of the array.

> Is the annotation also needed for the C99 version (ob_array[])?
I tested and for the C99 version the annotation is not needed. Apparently 
ob_array inherits the bounds of the structure in this case.

Regards,
Florin

----------

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

Reply via email to