Skip to content

RE2C version 4 emits warnings  #17204

Open
Open
@petk

Description

@petk

Description

The following code:

git clone https://github.com/skvadrik/re2c
cd re2c
git checkout 4.0.2
cmake -B build
cmake --build build -j

cd ../php-src
./buildconf
RE2C=../re2c/build/re2c ./configure
make

Resulted in this output:

ext/pdo/pdo_sql_parser.re:35:1: warning: control flow is undefined for strings that match '\x0', use default rule '*' [-Wundefined-control-flow]
ext/pdo_sqlite/sqlite_sql_parser.re:36:1: warning: control flow is undefined for strings that match '\x0', use default rule '*' [-Wundefined-control-flow]
Zend/zend_language_scanner.l:1816:19: warning: escape has no effect: '\*' [-Wuseless-escape]
Zend/zend_language_scanner.l:1820:19: warning: escape has no effect: '\*' [-Wuseless-escape]
Zend/zend_ini_scanner.l:355:13: warning: escape has no effect: '\.' [-Wuseless-escape]
Zend/zend_ini_scanner.l:355:32: warning: escape has no effect: '\.' [-Wuseless-escape]
Zend/zend_ini_scanner.l:362:32: warning: escape has no effect: '\[' [-Wuseless-escape]
Zend/zend_ini_scanner.l:364:11: warning: escape has no effect: '\[' [-Wuseless-escape]
Zend/zend_ini_scanner.l:661:66: warning: unreachable rule in condition 'ST_OFFSET' (shadowed by rule at line 606) [-Wunreachable-rules]
Zend/zend_ini_scanner.l:661:66: warning: unreachable rule in condition 'ST_SECTION_VALUE' (shadowed by rule at line 606) [-Wunreachable-rules]
...

But I expected output without RE2C specific warnings.

Probably all lexer-related files should be rechecked and updated a bit.

PHP Version

PHP 8.3

Operating System

Any

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions