From:             geerdeli at yahoo dot com dot cn
Operating system: win32 vc6.0 sp6
PHP version:      5.2.6
PHP Bug Type:     Compile Failure
Bug description:  php_mbregex.c (122) : error C2099: initializer is not a 
constant

Description:
------------
While compiling mbstring.dsp project under vc6.0,
The following source code in php_mbregex.c between line 122 and 234
"
php_mb_regex_enc_name_map_t enc_name_map[] ={
        {
                "EUC-JP\0EUCJP\0X-EUC-JP\0UJIS\0EUCJP\0EUCJP-WIN\0",
                 ONIG_ENCODING_EUC_JP
        },
..."

will always report the 
php_mbregex.c(122) : error C2099: initializer is not a constant
...



Reproduce code:
---------------
php_mb_regex_enc_name_map_t enc_name_map[] ={
        {
                "EUC-JP\0EUCJP\0X-EUC-JP\0UJIS\0EUCJP\0EUCJP-WIN\0",
                 ONIG_ENCODING_EUC_JP
        },
        {
                "UTF-8\0UTF8\0",
                ONIG_ENCODING_UTF8
        },
        {
                "UTF-16\0UTF-16BE\0",
                ONIG_ENCODING_UTF16_BE
        },
        {
                "UTF-16LE\0",
                ONIG_ENCODING_UTF16_LE
        },
        {
                "UCS-4\0UTF-32\0UTF-32BE\0",
                ONIG_ENCODING_UTF32_BE
        },
        {
                "UCS-4LE\0UTF-32LE\0",
                ONIG_ENCODING_UTF32_LE
        },
        {
                "SJIS\0CP932\0MS932\0SHIFT_JIS\0SJIS-WIN\0WINDOWS-31J\0",
                ONIG_ENCODING_SJIS
        },
        {
                "BIG5\0BIG-5\0BIGFIVE\0CN-BIG5\0BIG-FIVE\0",
                ONIG_ENCODING_BIG5
        },
        {
                "EUC-CN\0EUCCN\0EUC_CN\0GB-2312\0GB2312\0",
                ONIG_ENCODING_EUC_CN
        },
        {
                "EUC-TW\0EUCTW\0EUC_TW\0",
                ONIG_ENCODING_EUC_TW
        },
        {
                "EUC-KR\0EUCKR\0EUC_KR\0",
                ONIG_ENCODING_EUC_KR
        },
        {
                "KOI8\0KOI-8\0",
                ONIG_ENCODING_KOI8
        },
        {
                "KOI8R\0KOI8-R\0KOI-8R\0",
                ONIG_ENCODING_KOI8_R
        },
        {
                "ISO-8859-1\0ISO8859-1\0ISO_8859_1\0ISO8859_1\0",
                ONIG_ENCODING_ISO_8859_1
        },
        {
                "ISO-8859-2\0ISO8859-2\0ISO_8859_2\0ISO8859_2\0",
                ONIG_ENCODING_ISO_8859_2
        },
        {
                "ISO-8859-3\0ISO8859-3\0ISO_8859_3\0ISO8859_3\0",
                ONIG_ENCODING_ISO_8859_3
        },
        {
                "ISO-8859-4\0ISO8859-4\0ISO_8859_4\0ISO8859_4\0",
                ONIG_ENCODING_ISO_8859_4
        },
        {
                "ISO-8859-5\0ISO8859-5\0ISO_8859_5\0ISO8859_5\0",
                ONIG_ENCODING_ISO_8859_5
        },
        {
                "ISO-8859-6\0ISO8859-6\0ISO_8859_6\0ISO8859_6\0",
                ONIG_ENCODING_ISO_8859_6
        },
        {
                "ISO-8859-7\0ISO8859-7\0ISO_8859_7\0ISO8859_7\0",
                ONIG_ENCODING_ISO_8859_7
        },
        {
                "ISO-8859-8\0ISO8859-8\0ISO_8859_8\0ISO8859_8\0",
                ONIG_ENCODING_ISO_8859_8
        },
        {
                "ISO-8859-9\0ISO8859-9\0ISO_8859_9\0ISO8859_9\0",
                ONIG_ENCODING_ISO_8859_9
        },
        {
                "ISO-8859-10\0ISO8859-10\0ISO_8859_10\0ISO8859_10\0",
                ONIG_ENCODING_ISO_8859_10
        },
        {
                "ISO-8859-11\0ISO8859-11\0ISO_8859_11\0ISO8859_11\0",
                ONIG_ENCODING_ISO_8859_11
        },
        {
                "ISO-8859-13\0ISO8859-13\0ISO_8859_13\0ISO8859_13\0",
                ONIG_ENCODING_ISO_8859_13
        },
        {
                "ISO-8859-14\0ISO8859-14\0ISO_8859_14\0ISO8859_14\0",
                ONIG_ENCODING_ISO_8859_14
        },
        {
                "ISO-8859-15\0ISO8859-15\0ISO_8859_15\0ISO8859_15\0",
                ONIG_ENCODING_ISO_8859_15
        },
        {
                "ISO-8859-16\0ISO8859-16\0ISO_8859_16\0ISO8859_16\0",
                ONIG_ENCODING_ISO_8859_16
        },
        {
                "ASCII\0US-ASCII\0US_ASCII\0ISO646\0",
                ONIG_ENCODING_ASCII
        },
        { NULL, ONIG_ENCODING_UNDEF }

};

Expected result:
----------------
program being compile without compile error.

Actual result:
--------------
29 error(s),error C2099: initializer is not a constant, reported by vc6.0

-- 
Edit bug report at http://bugs.php.net/?id=45616&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45616&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45616&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45616&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45616&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45616&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45616&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45616&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45616&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45616&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45616&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45616&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45616&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45616&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45616&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45616&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45616&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45616&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45616&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45616&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45616&r=mysqlcfg

Reply via email to