ID:               42502
 User updated by:  supportnew at byethost dot com
 Reported By:      supportnew at byethost dot com
 Status:           Assigned
 Bug Type:         mbstring related
 Operating System: debian linux 4
 PHP Version:      5.2.4
 Assigned To:      hirokawa
 New Comment:

I done the following

web3:~# cd /root
web3:~# vi sample.c
web3:~# gcc sample.c -o sample
web3:~# ./sample
web3:~#                            

web3:~# cat sample.c
#include <stdarg.h>
int foo(int x, ...) {
        va_list va;
        va_start(va, x);
        va_arg(va, int);
        va_arg(va, char *);
        va_arg(va, double);
        return 0;
}
int main() {
  return foo(10, "", 3.14);
}

on running the compiled sample nothing is returned.

Just a note, php 5.2.3 compiles file still on the same servers / with
same gcc, etc.


Previous Comments:
------------------------------------------------------------------------

[2007-09-16 09:56:26] [EMAIL PROTECTED]

The variable length argument defined in stdarg.h is not properly
detected for your system.

A possible workaround is force to define HAVE_STDARG_PROTOTYPES
in your main/php_config.h

#define HAVE_STDARG_PROTOTYPES 1

Could you show me the return code of 
a small program shown bellow ?

sample.c

#include <stdarg.h>
int foo(int x, ...) {
        va_list va;
        va_start(va, x);
        va_arg(va, int);
        va_arg(va, char *);
        va_arg(va, double);
        return 0;
}
int main() { 
  return foo(10, "", 3.14); 
}

> gcc sample.c -o sample




------------------------------------------------------------------------

[2007-09-16 09:52:26] [EMAIL PROTECTED]

#include <stdarg.h>
int foo(int x, ...) {
        va_list va;
        va_start(va, x);
        va_arg(va, int);
        va_arg(va, char *);
        va_arg(va, double);
        return 0;
}
int main() { 
return foo(10, "", 3.14); 
}

------------------------------------------------------------------------

[2007-09-13 05:31:01] chris at acu dot edu

This problem is also reproduceable on Solaris 10.

./configure --prefix=/opt/php-5.2.4
--with-apxs2=/usr/local/httpd/bin/apxs --with-mysql=/usr/local/mysql
--with-libxml-dir=/usr --enable-calendar --with-gd=/usr/local
--with-ttf=/usr --with-freetype-dir=/usr --enable-exif
--with-jpeg-dir=/usr --with-png-dir=/usr --with-zlib-dir=/usr --with-xsl
--with-pdo-sqlite --with-pdo-mysql=/usr/local/mysql --with-pear
--with-iconv=/usr/local --enable-ftp --with-curl=/opt/php-5.2.4
--enable-mbstring --enable-embedded-mysqli --with-gettext

using

$ gcc -v
Reading specs from /usr/sfw/lib/gcc/i386-pc-solaris2.11/3.4.3/specs
Configured with:
/builds2/sfwnv-gate/usr/src/cmd/gcc/gcc-3.4.3/configure
--prefix=/usr/sfw --with-as=/usr/sfw/bin/gas --with-gnu-as
--with-ld=/usr/ccs/bin/ld --without-gnu-ld
--enable-languages=c,c++,f77,objc --enable-shared
Thread model: posix
gcc version 3.4.3 (csl-sol210-3_4-20050802)

produces the same error as supportnew at byethost dot com

------------------------------------------------------------------------

[2007-09-12 11:58:15] [EMAIL PROTECTED]

Rui, feedback given.

------------------------------------------------------------------------

[2007-09-11 20:44:55] supportnew at byethost dot com

ahh , the file 

main/php_config.h exists , and

the following values are present

/* Define if stdarg.h is available */
/* #undef HAVE_STDARG_PROTOTYPES */


/* Define if you have the <stdarg.h> header file.  */
#define HAVE_STDARG_H 1

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/42502

-- 
Edit this bug report at http://bugs.php.net/?id=42502&edit=1

Reply via email to