php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20395 A handful of #ifdef's to compile under AIX using xlC
Submitted: 2002-11-12 10:51 UTC Modified: 2002-12-06 19:14 UTC
From: Lars-Owe dot Ivarsson at its dot uu dot se Assigned:
Status: No Feedback Package: Compile Failure
PHP Version: 4CVS-2002-11-12 OS: AIX 4.3.3ML10
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2002-11-12 10:51 UTC] Lars-Owe dot Ivarsson at its dot uu dot se
Please consider the changes below to make the latest snapshot compile using xlc invoked as cc_r:

root@limosa$ diff -c ext/mbstring/mbfilter.h* 
*** ext/mbstring/mbfilter.h     Tue Nov 12 17:15:20 2002
--- ext/mbstring/mbfilter.h~    Sun Nov 10 18:37:22 2002
***************
*** 464,473 ****
  const char *
  mbfl_identify_encoding_name(mbfl_string *string, enum mbfl_no_encoding *elist, int eliztsz TSRMLS_DC);
  
! #ifndef _AIX
! const
! #endif
!  enum mbfl_no_encoding
  mbfl_identify_encoding_no(mbfl_string *string, enum mbfl_no_encoding *elist, int eliztsz TSRMLS_DC);
  
  /*
--- 464,470 ----
  const char *
  mbfl_identify_encoding_name(mbfl_string *string, enum mbfl_no_encoding *elist, int eliztsz TSRMLS_DC);
  
! const enum mbfl_no_encoding
  mbfl_identify_encoding_no(mbfl_string *string, enum mbfl_no_encoding *elist, int eliztsz TSRMLS_DC);
  
  /*
root@limosa$ diff -c ext/mbstring/mbfilter.c*
*** ext/mbstring/mbfilter.c     Tue Nov 12 17:16:20 2002
--- ext/mbstring/mbfilter.c~    Sun Nov 10 18:37:22 2002
***************
*** 7557,7566 ****
        }
  }
  
! #ifndef _AIX
! const 
! #endif
! enum mbfl_no_encoding
  mbfl_identify_encoding_no(mbfl_string *string, enum mbfl_no_encoding *elist, int eliztsz TSRMLS_DC)
  {
        const mbfl_encoding *encoding;
--- 7557,7563 ----
        }
  }
  
! const enum mbfl_no_encoding
  mbfl_identify_encoding_no(mbfl_string *string, enum mbfl_no_encoding *elist, int eliztsz TSRMLS_DC)
  {
        const mbfl_encoding *encoding;
root@limosa$ diff -c ext/mysql/libmysql/my_tempnam.c*
*** ext/mysql/libmysql/my_tempnam.c     Tue Nov 12 17:19:22 2002
--- ext/mysql/libmysql/my_tempnam.c~    Fri Aug 23 17:56:34 2002
***************
*** 96,116 ****
    old_env=(char**)environ;
    if (dir)
    {                   /* Don't use TMPDIR if dir is given */
- #ifndef _AIX
      ((char **)environ)=(char**)temp_env;              /* May give warning */
- #else
-     environ=(char**)temp_env;         /* May give warning */
- #endif
      temp_env[0]=0;
    }
  #endif
    res=tempnam((char*) dir,(my_string) pfx); /* Use stand. dir with prefix */
  #ifndef OS2
- #ifndef _AIX
    ((char**)environ)=(char**)old_env;          /* May give warning */
- #else
-   environ=(char**)old_env;            /* May give warning */
- #endif
  #endif
    if (!res)
      DBUG_PRINT("error",("Got error: %d from tempnam",errno));
--- 96,108 ----
root@limosa$ diff -c ext/standard/file.c*
*** ext/standard/file.c Tue Nov 12 17:23:29 2002
--- ext/standard/file.c~        Sun Nov 10 18:37:36 2002
***************
*** 870,882 ****
  
        zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(options), &pos);
        while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(options), (void**)&wval, &pos)) {
!               if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(options), &wkey, &wkey_len, (unsigned int *)NULL, 0, &pos)
                        && Z_TYPE_PP(wval) == IS_ARRAY) {
  
                      zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(wval), &opos);
                      while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(wval), (void**)&oval, &opos)) {
  
!                       if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), &okey, &okey_len, (unsigned int *)NULL, 0, &opos)) {
                                ZVAL_ADDREF(*oval);
                                php_stream_context_set_option(context, wkey, okey, *oval);
                        }
--- 870,882 ----
  
        zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(options), &pos);
        while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_P(options), (void**)&wval, &pos)) {
!               if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_P(options), &wkey, &wkey_len, NULL, 0, &pos)
                        && Z_TYPE_PP(wval) == IS_ARRAY) {
  
                      zend_hash_internal_pointer_reset_ex(Z_ARRVAL_PP(wval), &opos);
                      while (SUCCESS == zend_hash_get_current_data_ex(Z_ARRVAL_PP(wval), (void**)&oval, &opos)) {
  
!                       if (HASH_KEY_IS_STRING == zend_hash_get_current_key_ex(Z_ARRVAL_PP(wval), &okey, &okey_len, NULL, 0, &opos)) {
                                ZVAL_ADDREF(*oval);
                                php_stream_context_set_option(context, wkey, okey, *oval);
                        }
root@limosa$ diff -c ext/standard/php_image.h*
*** ext/standard/php_image.h    Tue Nov 12 17:26:44 2002
--- ext/standard/php_image.h~   Mon Jun 24 21:36:26 2002
***************
*** 54,63 ****
  
  PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC);
  
! PHPAPI
! #ifndef _AIX
!  const
! #endif
!  char * php_image_type_to_mime_type(int image_type);
  
  #endif /* PHP_IMAGE_H */
--- 54,59 ----
  
  PHPAPI int php_getimagetype(php_stream *stream, char *filetype TSRMLS_DC);
  
! PHPAPI const char * php_image_type_to_mime_type(int image_type);
  
  #endif /* PHP_IMAGE_H */
root@limosa$ diff -c main/SAPI.c*
*** main/SAPI.c Tue Nov 12 17:30:09 2002
--- main/SAPI.c~      Sun Nov 10 18:37:40 2002
***************
*** 355,361 ****
                efree(SG(request_info).post_data);
        }  else       if (SG(server_context)) {
                if(sapi_module.read_post) { 
!                     /* make sure we've consumed all request input data */
                      char dummy[SAPI_POST_BLOCK_SIZE];
                      while(sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC) > 0) {
                        /* empty loop body */
--- 355,361 ----
                efree(SG(request_info).post_data);
        }  else       if (SG(server_context)) {
                if(sapi_module.read_post) { 
!                     // make sure we've consumed all request input data
                      char dummy[SAPI_POST_BLOCK_SIZE];
                      while(sapi_module.read_post(dummy, sizeof(dummy)-1 TSRMLS_CC) > 0) {
                        /* empty loop body */
root@limosa$

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-12 10:56 UTC] nicos@php.net
I dont think it's a bug.
Please take this to php.dev.

Thanks for your report.
 [2002-11-12 11:40 UTC] Lars-Owe dot Ivarsson at its dot uu dot se
I beg to differ, at least regarding to the use of // as comment syntax in a C (not C++) file, and casting lvalues is a bit unorthodox too.  Relevant compiler errors are as follows:


"/usr/local/src/php4-200211101739/ext/mysql/libmysql/my_tempnam.c", line 99.5: 1
506-025 (S) Operand must be a modifiable lvalue.
"/usr/local/src/php4-200211101739/ext/mysql/libmysql/my_tempnam.c", line 105.3: 
1506-025 (S) Operand must be a modifiable lvalue.
make: *** [ext/mysql/libmysql/my_tempnam.lo] Error 1



"/usr/local/src/php4-200211101739/main/SAPI.c", line 358.25: 1506-046 (S) Syntax
 error.
"/usr/local/src/php4-200211101739/main/SAPI.c", line 358.75: 1506-209 (S) Charac
ter constants must end before the end of a line.
"/usr/local/src/php4-200211101739/main/SAPI.c", line 358.40: 1506-076 (W) Charac
ter constant 've consumed all request input data' has more than one character. N
o more than rightmost 4 characters are used.
"/usr/local/src/php4-200211101739/main/SAPI.c", line 358.28: 1506-045 (S) Undecl
ared identifier make.
"/usr/local/src/php4-200211101739/main/SAPI.c", line 360.66: 1506-045 (S) Undecl
ared identifier dummy.
"/usr/local/src/php4-200211101739/main/SAPI.c", line 360.53: 1506-045 (S) Undecl
ared identifier dummy.
make: *** [main/SAPI.lo] Error 1
 [2002-11-12 11:59 UTC] derick@php.net
Can you please make a unified diff (cvs diff -u) and post the patch somewhere on the net? This bug system mangles your patch.

Derick
 [2002-11-26 20:01 UTC] sniper@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php4-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php4-win32-latest.zip


 [2002-12-06 19:14 UTC] sniper@php.net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC