|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2020-05-08 18:52 UTC] grzegorz129 at gmail dot com
Description:
------------
When parsing function declarations containing "const CUSTOM_TYPE *" the FFI modules wrongly states that unsupported specifier combination was used. When type is properly defined the FFI module is able to parse them without a problem.
Test script:
---------------
<?php
//Result: no error
\FFI::cdef('
typedef unsigned long u_long;
typedef u_long oid;
struct tree *get_tree(const oid *, size_t, struct tree *);
');
//vs.
//Result: FFI\ParserException: unsupported type specifier combination at line 1
\FFI::cdef('struct tree *get_tree(const oid *, size_t, struct tree *);');
Expected result:
----------------
FFI\ParserException: undefined C type 'oid'
Actual result:
--------------
FFI\ParserException: unsupported type specifier combination
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
Yes, in this example (since I'm only slightly familiar with C) it took ma a longer while to realize that the definition is correct but the type is missing. However, another example where I've got the same error about unsupported type was much more complex and really made me believe it's not supported (while in reality it was just missing "netsnmp_variable_list" typedef): struct tree { #... int (*printomat) (u_char **, size_t *, size_t *, int, const netsnmp_variable_list *, const struct enum_list *, const char *, const char *); #... }