Bug 1592760 - flex generates comparison between signed and unsigned integer
Summary: flex generates comparison between signed and unsigned integer
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: flex
Version: 28
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Arjun Shankar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-06-19 09:07 UTC by michael.mcternan
Modified: 2019-05-28 22:08 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2019-05-28 22:08:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Fix for warnings in generated code. (381 bytes, patch)
2018-06-26 09:46 UTC, michael.mcternan
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1210022 0 unspecified CLOSED flex produces output with compiler warnings 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1373601 0 unspecified CLOSED flex generates comparison between signed and unsigned integer 2021-02-22 00:41:40 UTC

Description michael.mcternan 2018-06-19 09:07:40 UTC
Description of problem:

Compiling the code generated by flex produces the following compiler warning:

lexer.c: In function ‘yy_scan_bytes’:
lexer.c:1813:17: warning: comparison of integer expressions of different signedness: ‘yy_size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
  for ( i = 0; i < _yybytes_len; ++i )
                 ^

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

flex-2.6.1-7.fc28.x86_64
gcc-8.1.1-1.fc28.x86_64

Compiling with -Wall

How reproducible:

100%

Steps to Reproduce:
1. Produce any simple flex gramar
2. Use flex to generate lexer sources
3. Compile sources with -Wall

Actual results:

Compiler warning.

Expected results:

No compiler warning.

Additional info:

This is a long standing bug, also reported in Fedora 24 (#1373601) and CentOS 7 (#1210022). 

The CentOS 7 bug is VERIFIED at present and contains patches and additional information.  It maybe possible to bring the same fixes easilty into Fedora 28.

Comment 1 michael.mcternan 2018-06-25 15:37:41 UTC
Vanilla flex 2.6.4 doesn't produce these warnings and has many less warnings when building the sources too.

Comment 2 michael.mcternan 2018-06-26 09:46:28 UTC
Created attachment 1454614 [details]
Fix for warnings in generated code.

This changes the local loop variable to the same type as the limit value, an int as passed into the function.

This fixes the compiler warnings in the generated code.

Comment 3 Ben Cotton 2019-05-02 21:05:54 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 4 Ben Cotton 2019-05-28 22:08:32 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.