Bug #78714 [Asn->Csd]: funcs returning pointer can't use call convention spec
| From: | dmitry@php.net | Date: | Mon, 11 Nov 2019 09:08:35 +0000 |
| Subject: | Bug #78714 [Asn->Csd]: funcs returning pointer can't use call convention spec | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223675@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78714&edit=1
ID: 78714
Updated by: dmitry@php.net
Reported by: cmb@php.net
Summary: funcs returning pointer can't use call convention
spec
-Status: Assigned
+Status: Closed
Type: Bug
Package: *Extensibility Functions
Operating System: Windows
PHP Version: 7.4Git-2019-10-21 (Git)
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=ecd0c5b6ad68fb9255c07a96a25f0b7852e882ff
Log: Fixed bug #78714 (funcs returning pointer can't use call convention spec)
Previous Comments:
------------------------------------------------------------------------
[2019-10-21 14:51:54] cmb@php.net
Description:
------------
When declaring a function which returns a pointer, any calling
convention specifier is not recognized at the proper position (at
least the proper position for MSVC; not sure about other
compilers).
It appears to be possible to work around that issue by placing the
calling convention specifier between the base type and the
* (or
even by placing it between extern and the base type), but we
should support the proper order as well.
This issue has been found by Alexander Lisachenko.
Test script:
---------------
<?php
$ffi = FFI::cdef(
'char * __cdecl get_zend_version(void);',
'php7_debug.dll'
);
echo FFI::string($ffi->get_zend_version());
Expected result:
----------------
Zend Engine v3.4.0-dev, Copyright (c) Zend Technologies
Actual result:
--------------
Fatal error: Uncaught FFI\ParserException: unexpected '__cdecl' at line 1 in %s:4
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78714&edit=1