Author haubi
Recipients David.Edelsohn, delhallt, haubi
Date 2013-11-12.14:50:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1384267812.2.0.813129014618.issue17919@psf.upfronthosting.co.za>
In-reply-to
Content
This is a regression since 2.7.4 because of http://bugs.python.org/issue15989.

As the 'events' and 'revents' members of 'struct pollfd' both are bitfields, the question actually is why they need to be signed at all.

Additionally: I'm wondering why poll_modify() and internal_devpoll_register() haven't been updated along issue#15989, as both still have 'i' for the 'events' arg.

Attached patch (for hg-tip) changes the 'events' for 'struct pollfd' to be generally treated as unsigned short bitfield.

Not that I know of one, but the &0xffff hack may break on platforms where 'short' is not 16bits - casting to (unsigned short) instead feels more save.

Additional question: Would it make sense to have the 'BHIkK' types check for overflow?

Thank you!
History
Date User Action Args
2013-11-12 14:50:12haubisetrecipients: + haubi, David.Edelsohn, delhallt
2013-11-12 14:50:12haubisetmessageid: <1384267812.2.0.813129014618.issue17919@psf.upfronthosting.co.za>
2013-11-12 14:50:12haubilinkissue17919 messages
2013-11-12 14:50:11haubicreate