php-compiler icon indicating copy to clipboard operation
php-compiler copied to clipboard

Fix bug in PHP-CParser to support Ubuntu 18.04 (and modern libc)

Open ircmaxell opened this issue 6 years ago • 0 comments

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...

ircmaxell avatar Apr 22 '19 17:04 ircmaxell