php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24182 va_arg macro error in Zend/zend.c
Submitted: 2003-06-13 22:20 UTC Modified: 2003-06-14 04:21 UTC
From: china at thewrittenword dot com Assigned:
Status: Closed Package: Compile Failure
PHP Version: 4.3.2 OS: Tru64 UNIX 4.0D
Private report: No CVE-ID: None
 [2003-06-13 22:20 UTC] china at thewrittenword dot com
Description:
------------
Tru64 UNIX 4.0D doesn't have vsnprintf(). So, the following code in Zend/zend.c is built:
  strncpy(z_error_message->value.str.val, va_arg(format,
  char *), ZEND_ERROR_BUFFER_SIZE);

Unfortunately, va_arg() in <varargs.h> on Tru64 UNIX expects the first argument ("format" in this case) to be of type struct va_list. Hence the error:
  cc: Error: /opt/build/php-4.3.2/Zend/zend.c, line 763: In this statement, "(format)" has a pointer type, but occurs in 
a context that requires a union or struct. (needstruct)
                   strncpy(z_error_message->value.str.val, va_arg(format, char *), ZEND_ERROR_BUFFER_SIZE);
----------------------------------------------------------------^
gmake: *** [Zend/zend.lo] Error 1

In <va_list.h>, va_list is defined as:
  typedef struct {
        char    **_a0;           
        int     _offset;                 
  } va_list;

I checked out CVS head and replaced the offending 4.3.2 Zend/zend.c code with CVS Zend/zend.c and it built ok. Is that the proper solution?


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-06-14 04:21 UTC] helly@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 22:01:26 2024 UTC