On 2014-04-14, John Gordon <gor...@panix.com> wrote:
> In <mailman.9260.1397511440.18130.python-l...@python.org> Ethan Furman 
> <et...@stoneleaf.us> writes:
>
>>          fprintf(stderr, "Could not allocate %d bytes.  errno=%d\n",
>>                  size, errno);
>
> %d is not the correct specifier for printing objects of type size_t.

I believe %zu is the correct format specifier for size_t values.

>>      char **envp_read;
>>      char **envp_write;
>
>>      if (envp_write < envp_read)
>>      {
>>          memset(envp_write, 0, ((unsigned int) envp_read -
>>                                 (unsigned int) envp_write));
>>      }
>
> I think it's complaining about casting the char ** objects to unsigned int.

If we assume that the author is trying to clear memory between the
addresses pointed to by the two variables, then it's probably better
be cast to (char *) before the subtracted.  That should result in an
integer value.

-- 
Grant Edwards               grant.b.edwards        Yow! Please come home with
                                  at               me ... I have Tylenol!!
                              gmail.com            
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to