Bug #78714 [NEW]: funcs returning pointer can't use call convention spec

From: Date: Mon, 21 Oct 2019 14:51:54 +0000
Subject: Bug #78714 [NEW]: funcs returning pointer can't use call convention spec
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-223361@lists.php.net to get a copy of this message
From: cmb Operating system: Windows PHP version: 7.4Git-2019-10-21 (Git) Package: *Extensibility Functions Bug Type: Bug Bug description:funcs returning pointer can't use call convention spec 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 bug report at https://bugs.php.net/bug.php?id=78714&edit=1 -- Fix committed: https://bugs.php.net/fix.php?id=78714&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=78714&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=78714&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=78714&r=needscript Try newer version: https://bugs.php.net/fix.php?id=78714&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=78714&r=support Expected behavior: https://bugs.php.net/fix.php?id=78714&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=78714&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=78714&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=78714&r=globals PHP version support discontinued: https://bugs.php.net/fix.php?id=78714&r=phptooold Daylight Savings: https://bugs.php.net/fix.php?id=78714&r=dst IIS Stability: https://bugs.php.net/fix.php?id=78714&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=78714&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=78714&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=78714&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=78714&r=mysqlcfg

« previous php.bugs (#223361) next »