This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author florin.papa
Recipients florin.papa, pitrou, r.david.murray, rhettinger, skrah, vstinner, zach.ware
Date 2015-12-03.11:42:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1449142942.88.0.327093836492.issue25300@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2015-12-03 11:42:22florin.papasetrecipients: + florin.papa, rhettinger, pitrou, vstinner, r.david.murray, skrah, zach.ware
2015-12-03 11:42:22florin.papasetmessageid: <1449142942.88.0.327093836492.issue25300@psf.upfronthosting.co.za>
2015-12-03 11:42:22florin.papalinkissue25300 messages
2015-12-03 11:42:22florin.papacreate