php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75677 Clang ignores fastcall calling convention on variadic function
Submitted: 2017-12-13 19:14 UTC Modified: -
From: lwhsu at lwhsu dot org Assigned:
Status: Closed Package: Compile Warning
PHP Version: master-Git-2017-12-13 (Git) OS: Ubuntu/FreeBSD
Private report: No CVE-ID: None
 [2017-12-13 19:14 UTC] lwhsu at lwhsu dot org
Description:
------------
On a 32-bit system compile a php embedded program with clang will result warning or error like this:

In file included from a.c:1:
In file included from /usr/include/php/20160303/main/php.h:36:
In file included from /usr/include/php/20160303/Zend/zend.h:36:
/usr/include/php/20160303/Zend/zend_hash.h:141:15: error: fastcall calling convention ignored on
      variadic function [-Werror,-Wignored-attributes]
ZEND_API void ZEND_FASTCALL 2(HashTable *ht, apply_func_args_t app...
              ^
/usr/include/php/20160303/Zend/zend_portability.h:239:39: note: expanded from macro 'ZEND_FASTCALL'
# define ZEND_FASTCALL __attribute__((fastcall))
                                      ^
1 error generated.

This causes configuring some programs embed php failing.  It would be great if we can make ZEND_FASTCALL on this function conditional by compiler type.

Test script:
---------------
/* compile with clang on a 32-bit system */
#include <php.h>
#include <php_main.h>

int main() {
        php_request_startup();
        return 0;
}


Patches

Add a Patch

Pull Requests

Pull requests:

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-12-15 20:56 UTC] nikic@php.net
Automatic comment on behalf of lwhsu@lwhsu.org
Revision: http://git.php.net/?p=php-src.git;a=commit;h=72ec23d8233ac9a2071f991752cff55febb167d5
Log: Fix bug #75677: Drop fastcall attribute on variadic function
 [2017-12-15 20:56 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Wed Dec 12 07:01:25 2018 UTC