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 mark.dickinson
Recipients mark.dickinson, serhiy.storchaka
Date 2012-10-18.14:56:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1350572193.35.0.503899791259.issue16277@psf.upfronthosting.co.za>
In-reply-to
Content
> "0" lexeme is not 0 integer.

Ah yes, true.  C99 6.3.2.3 specifies an "integer *constant* expression".  So I was mistaken in thinking that converting an arbitrary integer-valued expression with value 0 to (void*) must always give a NULL pointer.

> I think it was wrong implementation, even if only in theoretical 
> considerations.

Okay, but do you agree that (1) there's no undefined behaviour, and (2) removing this code has the potential to change results on platforms where converting NULL to an integer doesn't give zero?

If you agree with those two things, then this is a behaviour change, not a bugfix, and you should open a new issue aimed at 3.4 for that.

> I believe Python does not support platforms where it matters.

What's your justification for this belief?

> This provides the invariant PyLong_FromVoidPtr(NULL) == PyLong_FromLong(0) and 
does not cost anything on platforms where (Py_uintptr_t)(void *)NULL == 0.

Sorry, but this is making no sense to me.  You wrote: "(Py_uintptr_t)p - (Py_uintptr_t)(void *)NULL".  Is that supposed to be existing code that you're proposing changing?  An example to prove some point (what point?)  Code you're proposing to add somewhere?  (If so, where are you proposing to add it?)  Why are you subtracting these two pointers?  What's p?  I'm finding it hard to make sense of what you're writing.
History
Date User Action Args
2012-10-18 14:56:33mark.dickinsonsetrecipients: + mark.dickinson, serhiy.storchaka
2012-10-18 14:56:33mark.dickinsonsetmessageid: <1350572193.35.0.503899791259.issue16277@psf.upfronthosting.co.za>
2012-10-18 14:56:33mark.dickinsonlinkissue16277 messages
2012-10-18 14:56:32mark.dickinsoncreate