Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1210022

Summary: flex produces output with compiler warnings
Product: Red Hat Enterprise Linux 7 Reporter: Sean Johnston <sean.johnston>
Component: flexAssignee: Arjun Shankar <ashankar>
Status: CLOSED ERRATA QA Contact: Edjunior Barbosa Machado <emachado>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.1CC: aschorr, emachado, law, mcermak, mnewsome, pfrankli, pwouters
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: flex-2.5.37-5.el7 Doc Type: Bug Fix
Doc Text:
Cause: `flex' generates scanner code (lex.yy.c) containing a comparison between signed and unsigned integers. Consequence: Compiling a flex generated scanner with 'g++' and turning on all warnings with the '-Wall' compiler option generates a warning due to the comparison. Fix: 'flex' is fixed so as not to compare integer types with different signed-ness. Result: No warning corresponding to comparison of signed and unsigned integers is generated when compiling 'flex' output with 'g++ -Wall'.
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-10-30 10:13:29 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1565233    
Attachments:
Description Flags
fix compiler "comparison between signed and unsigned integer" warning in yy_scan_bytes none

Description Sean Johnston 2015-04-08 17:11:00 UTC
Description of problem:

flex produces code with compiler warnings, resulting in failure to compile when using -Wall -Werror for C++. Specifically it generates:

error: comparison between signed and unsigned integer expressions

Version-Release number of selected component (if applicable):

2.5.37-3.el7

How reproducible:

Pretty simple.

Steps to Reproduce:
1. Any valid lex file.
2. run flex (flex file.l)
3. compile output as C++ with all warnings (g++ -c -Wall lex.yy.c)

Actual results:

lex.yy.c: In function ‘yy_buffer_state* test__scan_bytes(const char*, yy_size_t)’:
lex.yy.c:1487:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for ( i = 0; i < _yybytes_len; ++i )


Expected results:

No output. Object file (.o) created.

Additional info:

This has been fixed in Fedora, multiple times it looks like. See bug 411151, bug 445950, bug 993447. Can't find any sign of it making it to RHEL7 though.

Comment 3 Paul Wouters 2016-03-02 20:57:52 UTC
See also https://sourceforge.net/p/flex/bugs/201/ if upgrading to flex 2.6.0. Similar problem but in different part of the code.

Comment 5 Andrew J. Schorr 2017-04-13 20:08:12 UTC
This problem is still present in RHEL 7.3. When is it going to be fixed?

Comment 6 Jeff Law 2017-04-14 03:11:35 UTC
We have policies and procedures for prioritizing which bugs are fixed in any given release -- to date this bug has not met the criteria set for  Red Hat Enterprise Linux 7 updates.

If you are a Red Hat Enterprise Linux customer and this is an important bug for you, please reach out to your customer service representative so they can take appropriate steps to ensure this bug is prioritized appropriately.

Comment 7 Andrew J. Schorr 2017-04-14 15:25:10 UTC
Created attachment 1271694 [details]
fix compiler "comparison between signed and unsigned integer" warning in yy_scan_bytes

This fixes the problem for me.

Regards,
Andy

Comment 14 errata-xmlrpc 2018-10-30 10:13:29 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3126