php-compiler
php-compiler copied to clipboard
Fix bug in PHP-CParser to support Ubuntu 18.04 (and modern libc)
Currently, PHP-CParser uses a hand-rolled parser for C pre-processor declarations. This turns out to be buggy on 18.04 since they use ternary if statements. Specifically, /usr/include/features.h contains:
#if defined __cplusplus ? __cplusplus >= 201402L : defined __USE_ISOC11
# define __GLIBC_USE_DEPRECATED_GETS 0
#else
# define __GLIBC_USE_DEPRECATED_GETS 1
#endif
The current parser syntax errors at the >= symbol since it's not expecting arbitrary nested expressions...