php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #26769 64 bit pointer
Submitted: 2004-01-02 17:12 UTC Modified: 2004-01-03 00:25 UTC
From: yu at fstrf dot org Assigned:
Status: Wont fix Package: Compile Warning
PHP Version: 4.3.4 OS: Solaris 8/sparcv9
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yu at fstrf dot org
New email:
PHP Version: OS:

 

 [2004-01-02 17:12 UTC] yu at fstrf dot org
Description:
------------
I am compiling PHP under solaris 8 /sparcv9 for 64-bit version. I get a successful compilation except the following warnings. 

php-4.3.4/ext/standard/exec.c:588: warning: cast from pinter to integer of different size
php-4.3.4/ext/standard/exec.c: In function `zif_proc_open':
php-4.3.4/ext/standard/exec.c:1007: warning: cast to pointer from integer of different size

Here is the code in exec.c,
-----------------------------------------------------------
line# 586: pid_t child, wait_pid;
line# 587:
line# 588: child = (pid_t)rsrc->ptr;
.
.
.
line# 1007: ZEND_REGISTER_RESOURCE(return_value, (void*)child, le_proc_open);
-----------------------------------------------------------

Since pid_t is defined in solaris8/sparv9 in 32 bit and pointer is 64 bit, I am worried an assignment from 64-bit pointer to a 32-bit integer would cause segmentation fault in the runtime.

Can anybody help me on that?
Thank you,

Maggie



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-01-03 00:25 UTC] pollita@php.net
It's a harmless warning.

rsrc->ptr is a generic use "bucket".  Generally it's meant to hold a pointer to some data.  In this case, pid_t is trusted to never have a larger storage size than void* (to do so would require 16-bit pointers and 32-bit PIDs or 32-bit pointers and 64-bit PIDs, etc...) so rather than malloc()ing a container for child, we just drop child itself into the pointer bucket.

Bottom line, don't worry.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 14 10:01:28 2024 UTC