php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39975 Some error in C/C++ syntax
Submitted: 2006-12-28 12:44 UTC Modified: 2007-02-06 09:52 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: kprzemek at coig dot katowice dot pl Assigned: tony2001 (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.2.0 OS: IBM AIX 5.3
Private report: No CVE-ID: None
 [2006-12-28 12:44 UTC] kprzemek at coig dot katowice dot pl
Description:
------------
Since the release of version 5.0 the same errors still appear in the repository. These are the C/C++ syntax error, which are ignored by GCC. However, while compiling the code under IBM C/C++ they cause critical errors and STOP the compilation. These are just several errors. Could you please correct them, I'm sure that everyone compiling without GCC will be grateful for that. Below you can find the list of files and location of the errors and my fixes(diff).

Reproduce code:
---------------
# diff openssl.c new/openssl.c
61c61
<       ZEND_END_ARG_INFO();
---
>       ZEND_END_ARG_INFO()
72c72
<       OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA,
---
>       OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA
==============
type redefine:
# diff parse_date.c new/parse_date.c
88c88,91
< typedef unsigned char uchar;
---
> /* Type exist in sys/types.h !!
>  *
>  * typedef unsigned char uchar;
>  */
=================
# diff php_hash_tiger.h new/php_hash_tiger.h
28,29c28,29
<       unsigned char passes:1;
<       unsigned char length:7;
---
>       unsigned int passes:1;
>       unsigned int length:7;
===================
Last table element:
# diff php_pcre.c new/php_pcre.c
55c55
<       PHP_PCRE_BAD_UTF8_ERROR,
---
>       PHP_PCRE_BAD_UTF8_ERROR
=================
# diff php_spl.c new/php_spl.c
646c646
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
653c653
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
====================
Last table element:
# api.h new/php_stream_filter_api.h             <
65c65
<       PSFS_PASS_ON,   /* filter generated output buckets; pass them on to next in chain */
---
>       PSFS_PASS_ON    /* filter generated output buckets; pass them on to next in chain */
=====================
Last table element:
# diff spl_directory.h new/spl_directory.h
38c38
<       SPL_FS_FILE,
---
>       SPL_FS_FILE
======================
C is NOT php:
# diff spl_iterators.c new/spl_iterators.c
754c754
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
759c759
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
764c764
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1484c1484
<               return;// NULL
---
>               return; /* NULL */
1640c1640
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1657c1657
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1684c1684
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1689c1689
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1694c1694
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1699c1699
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1720c1720
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1852c1852
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1864c1864
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
1869c1869
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2232c2232
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2237c2237
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2242c2242
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2248c2248
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2307c2307
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2326c2326
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2410c2410
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
2643c2643
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
===============
last table element:
# diff spl_iterators.h new/spl_iterators.h
95c95
<       REGIT_USE_KEY            = 0x00000001,
---
>       REGIT_USE_KEY            = 0x00000001
104c104
<       REGIT_MODE_MAX,
---
>       REGIT_MODE_MAX
=====================
Add for IBM C/C++:
# diff zend_alloc.c new/zend_alloc.c
265a266
> #if ZEND_DEBUG
272a274
> # endif
---
#if ZEND_DEBUG
typedef enum _mem_magic {
        MEM_BLOCK_VALID  = 0x7312F8DC,
        MEM_BLOCK_FREED  = 0x99954317,
        MEM_BLOCK_CACHED = 0xFB8277DC,
        MEM_BLOCK_GUARD  = 0x2A8FCC84,
        MEM_BLOCK_LEAK   = 0x6C5E8F2D
} mem_magic;
# endif


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-28 12:59 UTC] tony2001@php.net
Let's deal with these problems one by one.
First of all, I'm reall suprised by this:
<       ZEND_END_ARG_INFO();
---
>       ZEND_END_ARG_INFO()

Do you REALLY mean it's a syntax error for IBM compiler?

The parse_date.c change is not good, AIX is not the only OS here..
And what's wrong with php_hash_tiger.h and zend_alloc.c?
 [2006-12-29 09:03 UTC] kprzemek at coig dot katowice dot pl
Here is the step-by-step description of all errors consecutively as they appear.My compiler is:
VisualAge C++ Professional / C for AIX Compiler, Version 5
Now the errors:
# api.h new/php_stream_filter_api.h             <
65c65
<       PSFS_PASS_ON,   /* filter generated output buckets; pass them on to next in chain */
---
>       PSFS_PASS_ON    /* filter generated output buckets; pass them on to next in chain */
++++++ 
"/dv/usr/local/DEV/php-5.2.0/main/streams/php_stream_filter_api.h", line 65.21: 1506-275 (S) Unexpected text ',' encountered.
=====================
# diff openssl.c new/openssl.c
61c61
<       ZEND_END_ARG_INFO();
---
>       ZEND_END_ARG_INFO()
72c72
<       OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA,
---
>       OPENSSL_KEYTYPE_DEFAULT = OPENSSL_KEYTYPE_RSA
++++++
"/dv/usr/local/DEV/php-5.2.0/ext/openssl/openssl.c", line 61.28: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/openssl/openssl.c", line 72.54: 1506-275 (S) Unexpected text ',' encountered.
make: *** [ext/openssl/openssl.lo] Error 1
==============
# diff php_pcre.c new/php_pcre.c
55c55
<       PHP_PCRE_BAD_UTF8_ERROR,
---
>       PHP_PCRE_BAD_UTF8_ERROR
59.34
< ZEND_DECLARE_MODULE_GLOBALS(pcre);
---
> ZEND_DECLARE_MODULE_GLOBALS(pcre)
+++++
"/dv/usr/local/DEV/php-5.2.0/ext/pcre/php_pcre.c", line 55.32: 1506-275 (S) Unexpected text ',' encountered.
"/dv/usr/local/DEV/php-5.2.0/ext/pcre/php_pcre.c", line 59.34: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
make: *** [ext/pcre/php_pcre.lo] Error 1
=================
# diff parse_date.c new/parse_date.c
88c88,91
< typedef unsigned char uchar;
---
> /* Typ z sys/types.h !!
>  *
>  * typedef unsigned char uchar;
>  */
+++++
php-5.2.0/ext/date/lib/parse_date.c", line 88.23: 1506-334 (S) Identifier uchar has already been defined on line 519 of "/usr/include/sys/types.h".
php-5.2.0/ext/date/lib/parse_date.c", line 337.94: 1506-068 (S) Operation between types "illegal type*" and "illegal type*" is not allowed.
php-5.2.0/ext/date/lib/parse_date.c", line 346.90: 1506-068 (S) Operation between types "illegal type*" and "illegal type*" is not allowed.
php-5.2.0/ext/date/lib/parse_date.c", line 376.38: 1506-068 (S) Operation between types "illegal type*" and "illegal type*" is not allowed.
php-5.2.0/ext/date/lib/parse_date.c", line 377.36: 1506-068 (S) Operation between types "illegal type*" and "illegal type*" is not allowed.
php-5.2.0/ext/date/lib/parse_date.c", line 811.11: 1506-281 (S) Prefix and postfix increment and decrement operators cannot be applied to "illegal type*".
and MORE lines like that:
php-5.2.0/ext/date/lib/parse_date.c", line 1015.19: 1506-281 (S) Prefix and postfix increment and decrement operators cannot be applied to "illegal type*".
=================
# diff php_hash_tiger.h new/php_hash_tiger.h
28,29c28,29
<       unsigned char passes:1;
<       unsigned char length:7;
---
>       unsigned int passes:1;
>       unsigned int length:7;
+++++
"/dv/usr/local/DEV/php-5.2.0/ext/hash/php_hash_tiger.h", line 28.9: 1506-009 (S) Bit-field passes must be of type signed int, unsigned int or int.
"/dv/usr/local/DEV/php-5.2.0/ext/hash/php_hash_tiger.h", line 29.9: 1506-009 (S) Bit-field length must be of type signed int, unsigned int or int.
make: *** [ext/hash/hash_tiger.lo] Error 1
===================
# diff spl_directory.h new/spl_directory.h
38c38
<       SPL_FS_FILE,
---
>       SPL_FS_FILE
+++++
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_directory.h", line 38.20: 1506-275 (S) Unexpected text ',' encountered.
======================
# diff spl_iterators.h new/spl_iterators.h
95c95
<       REGIT_USE_KEY            = 0x00000001,
---
>       REGIT_USE_KEY            = 0x00000001
104c104
<       REGIT_MODE_MAX,
---
>       REGIT_MODE_MAX
+++++
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.h", line 95.46: 1506-275 (S) Unexpected text ',' encountered.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.h", line 104.23: 1506-275 (S) Unexpected text ',' encountered.
=====================
# diff php_spl.c new/php_spl.c
646c646
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
653c653
< ZEND_END_ARG_INFO();
---
> ZEND_END_ARG_INFO()
+++++
"/dv/usr/local/DEV/php-5.2.0/ext/spl/php_spl.c", line 646.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/php_spl.c", line 653.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
====================
# diff spl_iterators.c new/spl_iterators.c
[cat]
++++
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 754.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 759.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 764.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1484.24: 1506-046 (S) Syntax error.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1640.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1657.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1684.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1689.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1694.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1699.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1720.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1852.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1864.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 1869.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2232.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2237.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2242.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2248.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2307.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2326.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2410.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
"/dv/usr/local/DEV/php-5.2.0/ext/spl/spl_iterators.c", line 2643.20: 1506-137 (E) Declaration must declare at least one declarator, tag, or the members of an enumeration.
make: *** [ext/spl/spl_iterators.lo] Error 1
===============
Add for IBM C/C++
# diff zend_alloc.c new/zend_alloc.c
265a266
> #if ZEND_DEBUG
272a274
> # endif
---
#if ZEND_DEBUG
typedef enum _mem_magic {
        MEM_BLOCK_VALID  = 0x7312F8DC,
        MEM_BLOCK_FREED  = 0x99954317,
        MEM_BLOCK_CACHED = 0xFB8277DC,
        MEM_BLOCK_GUARD  = 0x2A8FCC84,
        MEM_BLOCK_LEAK   = 0x6C5E8F2D
} mem_magic;
# endif
"/dv/usr/local/DEV/php-5.2.0/Zend/zend_alloc.c", line 268.28: 1506-243 (S) Value of enumeration constant must be in range of signed integer.
"/dv/usr/local/DEV/php-5.2.0/Zend/zend_alloc.c", line 269.28: 1506-243 (S) Value of enumeration constant must be in range of signed integer.
make: *** [Zend/zend_alloc.lo] Error 1
==============
# diff ap_config_auto.h new/ap_config_auto.h
201.9
< #define WORDS_BIGENDIAN 1
---
> /* #define WORDS_BIGENDIAN 1 */
+++++
"/dv/usr/local/apache2059.p520/include/ap_config_auto.h", line 201.9: 1506-213 (S) Macro name WORDS_BIGENDIAN cannot be redefined.
"/dv/usr/local/apache2059.p520/include/ap_config_auto.h", line 201.9: 1506-358 (I) "WORDS_BIGENDIAN" is defined on line 946 of /dv/usr/local/DEV/php-5.2.0/include/../main/php_config.h.
make: *** [sapi/apache2handler/mod_php5.lo] Error 1
 [2006-12-29 19:24 UTC] orchard at engr dot wisc dot edu
I had to fix the following error to get the Sun C compiler to compile the program (I changed the comment to standard C syntax):

[eceserv1] 203% diff spl_iterators.c.orig spl_iterators.c
1484c1484
<               return;// NULL
---
>               return;/* // NULL */
 [2007-01-03 16:58 UTC] wharmby at uk dot ibm dot com
A couple of comments on this bug: 

1) VisualAge C++ Professional Version 5.0 for AIX went out
of support on December 31, 2003. The supported versions of
the IBM compilers are 6.0, 7.0, or 8.0.  However, you should check that you have the latest Version 5.0 PTF installed just in case this problem is resolved at that level. It can be found here:  

http://www.ibm.com/support/docview.wss?rs=0&uid=swg21156462

2) With each new version of the compiler changes have been made to enhance the portability from GNU C/C++ to the AIX compiler. This webpage describes such features in the latest Version 8.0 compilers:

http://www.ibm.com/software/awdtools/xlcpp/features/#GNU

I currently do not have access to a AIX system with the 
latest complier but I will look into getting access to one to to check whether or not the issues you highlight are fixed or not in a newer version of the AIX compiler.
 [2007-01-05 18:36 UTC] wharmby at uk dot ibm dot com
I have conducted a series of experiments today and results 
so far are listed below:

My environment:

 OS: AIX 5.2.0.0
 Compiler :  IBM(R) XL C Enterprise Edition V7.0
 PHP: PHP 5.2.1RC2-dev

With the following PHP configuration

    ./configure -enable-debug --enable-maintainer-zts  --disable-cgi
--enable-cli --with-libxml-dir=/u2/wharmby/freeware/xml2
--prefix=/u2/wharmby/php5

Ignoring the normal W(arning) messages the only compiler 
messages I get are E(rror) messages about badly defined 
bit-field's.  I get multiple instances of the following:

"/u2/wharmby/php5.2-200701040730/main/streams/php_stream_transport.h", line 136.27: 1506-159 (E) Bit-field type specified for how is not valid. Type unsigned assumed.

The offending code is as follows:

typedef struct _php_stream_xport_param {
    enum {
          STREAM_XPORT_OP_BIND, STREAM_XPORT_OP_CONNECT,
          STREAM_XPORT_OP_LISTEN, STREAM_XPORT_OP_ACCEPT,
          STREAM_XPORT_OP_CONNECT_ASYNC,
          STREAM_XPORT_OP_GET_NAME,
          STREAM_XPORT_OP_GET_PEER_NAME,
          STREAM_XPORT_OP_RECV,
          STREAM_XPORT_OP_SEND,
          STREAM_XPORT_OP_SHUTDOWN
    } op;
    unsigned int want_addr:1;
    unsigned int want_textaddr:1;
    unsigned int want_errortext:1;
    stream_shutdown_t how:3; <<< THIS IS LINE FLAGGED

e.t.c

stream_shutdown_t  is defined as follows:

typedef enum {
    STREAM_SHUT_RD,
    STREAM_SHUT_WR,
    STREAM_SHUT_RDWR
} stream_shutdown_t;

This is a variation of the bitfield problem reported above
when compiling hash_tiger.c. The complete list of messages for this with xlc V7 are:

cc -Iext/hash/ -I/u2/wharmby/php5.2-200701040730/ext/hash/ -DPHP_ATOM_INC
-I/u2/wharmby/php5.2-200701040730/include
-I/u2/wharmby/php5.2-200701040730/main -I/u2/wharmby/php5.2-200701040730
-I/u2/wharmby/freeware/xml2/include/libxml2
-I/u2/wharmby/php5.2-200701040730/ext/date/lib
-I/u2/wharmby/php5.2-200701040730/TSRM
-I/u2/wharmby/php5.2-200701040730/Zend -D_THREAD_SAFE -I/usr/include -g
-DZTS -c /u2/wharmby/php5.2-200701040730/ext/hash/hash_tiger.c -o
ext/hash/hash_tiger.o
"/u2/wharmby/php5.2-200701040730/main/streams/php_stream_transport.h", line
136.27: 1506-159 (E) Bit-field type specified for how is not valid. Type unsigned assumed.
"/u2/wharmby/php5.2-200701040730/ext/hash/php_hash_tiger.h", line 28.9: 1506-159 (E) Bit-field type specified for passes is not valid. Type unsigned assumed.
"/u2/wharmby/php5.2-200701040730/ext/hash/php_hash_tiger.h", a line 29.9: 1506-159 (E) Bit-field type specified for length is not valid. Type unsigned assumed.

The "E" messages allow the build to complete OK and runs its
basic regression tests but I have not run sufficient test 
to verify that the complier has generated valid code. However, regardless of whether the code generated is sound given that the same code compiles clean under gcc I will approach the compiler team to see if we can get the compiler
fixed to accept bit-fields of "unsigned char".

Other than that everything compiles OK, The problems regarding the spurious ";" after ZEND_ARG_INFO(), trailing "," in a enum e.t.c are fixed with xlc v7 when compiling with default complier options.

However, the default value for the langlvl compiler option with V7 when invoking compiler as cc is "extended". I have 
experimented a little by modifying the "-qlanglvl" compiler 
option The xlc manual lists amongst others the following:

"stdc89" Compilation conforms to the ANSI C89 standard, also known as ISO C90.

"stdc99" Compilation conforms to the ISO C99 standard.

"extc89" Compilation conforms to the ANSI C89 standard, and 
accepts implementation-specific language extensions.

"extc99" Compilation conforms to the ISO C99 standard, and 
accepts implementation-specific language extensions.

If I set langlvl to either stdc89 or stdc99 then I get ALL 
the messages as reported in the defect 39975 and the compilation is aborted e.g 

"/u2/wharmby/php5.2-200701040730/main/streams/php_stream_filter_api.h",
line 65.21: 1506-275 (S) Unexpected text ',' encountered.
"/u2/wharmby/php5.2-200701040730/main/streams/php_stream_transport.h", line 136.27: 1506-009 (S) Bit-field how must be of type signed int, unsigned int or int.

With either extc89 or extc99 I just get the "E" messages 
listed above and the build completes OK.

What is not clear to me at the moment is whether or not the code compiles OK with the V7 compiler because of fixes in the newer versions of compiler or whether its just a change in default "lnaglvl". As I dont have the V5 complier or its documentation to check I have contacted someone in the
complier team for clarification.

I will report back further next week when I have more information.

In the meantime you could try specifying the extra CFLAG of

     -qlanglvl=extc89|extc99
 
to see if 
  (a) its accepted by V5, and 
  (b) whether it reduces the number of compile failures
 [2007-01-11 12:33 UTC] wharmby at uk dot ibm dot com
Having acquired V5 documentation I can now confirm that 
-qlanglvl=extc89|extc99 is not supported under XL C V5 so cant use that to avoid the errors reported above.

I am in the process of raising a PMR against the XL C compiler to get the compiler fixed to avoid the error
message when bit fields defined on unsigned char types, e.g 

1506-159 (E) Bit-field type specified for how is not valid. Type unsigned assumed.

Will post again when I have news on progress of PMR
 [2007-01-17 09:45 UTC] wharmby at uk dot ibm dot com
PMR now raised to get XL C compiler fixed to avoid 
1506-159 error messages when bitfields defined on unsigned char type's. PMR number is 40951,999,866
 [2007-02-02 10:55 UTC] wharmby at uk dot ibm dot com
The IBM XL C service team have reviewed the PMR I raised and
whilst they agree it does highlight a gcc incompatibility 
the XL C compiler is adhering to the ISO standard as it 
stands. They have considered fixing this in currently 
supported version to improve the compatibility with gcc but 
cannot due to binary compatibility issues. I am in the  
process of getting the issue logged  so they can consider 
fixing it in a future version to improve gcc  compatibility.

However,  any fixed new version is in the future and the day
when all AIX users have this fixed version even further 
into the future so we either fix the PHP code to avoid the 
error messages or live with the error messages. The code generated by the compiler appears OK but the documentation does say

  "Compilation continues and object code is generated. Error
   conditions exist that the compiler can correct, but the
   program might not run correctly."

which will leave the user with a slight uneasy feeling that 
the code may not work.

The fixes required to avoid the messages are trivial so we should consider modifying the code unless anyone objects.
 [2007-02-02 12:45 UTC] wez@php.net
Andy pointed me to this... I'm surprised that we have stream_shutdown_t used as a bitfield.  If I wrote that line, it was likely a late night.

We should change this:

   stream_shutdown_t how:3;

to this:

   unsigned int how:3;

(technically, we should also remove the "int" keyword from those bitfields too, but most compilers will do the right thing).

 [2007-02-06 09:50 UTC] kprzemek at coig dot katowice dot pl
Thanks all for help
 [2007-02-06 09:52 UTC] kprzemek at coig dot katowice dot pl
thanks for help. I'll be waiting form IBM fix and have to buy new C compiller with support.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 18:01:35 2024 UTC