Fix developer build error on MacOS/Flex2.6.4 (https://github.com/verilator/verilator/pull/6153)

This commit is contained in:
Paul Swirhun 2025-07-02 19:56:10 -07:00 committed by GitHub
parent 4ddc649836
commit e0c3b42262
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -3365,6 +3365,8 @@ class LinkDotResolveVisitor final : public VNVisitor {
VL_DO_DANGLING(pushDeletep(nodep), nodep);
ok = true;
m_ds.m_dotText = "";
} else {
(void)defp; // Prevent unused variable warning
}
} else if (AstEnumItem* const valuep = VN_CAST(foundp->nodep(), EnumItem)) {
if (allowVar) {

View File

@ -18,13 +18,17 @@ for line in sys.stdin:
# Fix flex 2.6.1 warning
line = re.sub(r'for \( i = 0; i < _yybytes_len; \+\+i \)',
r'for ( i = 0; (yy_size_t)(i) < (yy_size_t)(_yybytes_len); ++i )', line)
# Fix flex 2.6.0 warning
# Fix flex 2.6.0+ sign comparison warnings
line = re.sub(
r'\(\(int\) \(\(yy_n_chars\) \+ number_to_move\) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size\)',
r'((int) ((yy_n_chars) + number_to_move) > (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size)',
line)
line = re.sub(r' number_to_move == YY_MORE_ADJ ', r' (int)number_to_move == (int)YY_MORE_ADJ ',
line)
line = re.sub(
r'\(\(\(yy_n_chars\) \+ number_to_move\) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size\)',
r'(((int)(yy_n_chars) + (int)number_to_move) > (int)YY_CURRENT_BUFFER_LVALUE->yy_buf_size)',
line)
# Fix flex 2.5.4 namespace omission
line = re.sub(r'^class istream;', '#include <iostream>\nusing namespace std;\n', line)
# Fix flex 2.5.31 redefinition