Bug 1373601

Summary: flex generates comparison between signed and unsigned integer
Product: [Fedora] Fedora Reporter: James Carter <jwcart2>
Component: flexAssignee: Patsy Griffin <pfrankli>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 24CC: dwalsh, me, pfrankli, sdsmall
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-08-08 17:06:32 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:

Description James Carter 2016-09-06 17:07:26 UTC
When compiling libsepol the following error is given:

<stdout>: In function ‘yy_get_next_buffer’:
<stdout>:642:18: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
<stdout>:1097:3: note: in expansion of macro ‘YY_INPUT’
cc1: all warnings being treated as errors

The following line is generated in the macro YY_INPUT():

		for ( n = 0; n < max_size && \
			     (c = getc( cil_yyin )) != EOF && c != '\n'; ++n ) \

n is defined as a size_t in the macro and max_size is a macro parameter. The macro is called in yy_get_next_buffer() and num_to_read, which is defined as an int, is passed for max_size.

Bugs 431151 and 993447 are at least similar in kind.

Comment 1 Stephen Smalley 2016-09-23 20:18:08 UTC
This prevents compiling the selinux userspace.

Comment 2 Patsy Griffin 2016-09-25 19:10:42 UTC
The fix for this has been submitted to rawhide.

Comment 3 Stephen Smalley 2016-10-05 15:12:43 UTC
Can we get it fixed in f25 and f24 too?

Comment 4 Stephen Smalley 2016-10-05 18:11:23 UTC
This is still broken in rawhide with flex-2.6.1-2.fc26.x86_64.

Comment 5 Patsy Griffin 2016-10-05 18:54:33 UTC
I'm looking at this now and will post and update ASAP.

Comment 6 Patsy Griffin 2016-10-05 21:59:09 UTC
Stephen,

Did you notice that n is now declared as an int just before the conditional?

Are you seeing something different?   Are you still seeing the error?

Thanks,
Patsy

Comment 7 Patsy Griffin 2016-10-05 22:01:10 UTC
Stephen, 

To clarify, my questions are related to rawhide.

I still need to update f24 and f25.

Thanks,
Patsy

Comment 8 Stephen Smalley 2016-10-06 12:46:56 UTC
Perhaps this is a different bug in the flex skeleton:
flex -t ../cil/src/cil_lexer.l > ../cil/src/cil_lexer.c
cc -Werror -Wall -W -Wundef -Wshadow -Wmissing-format-attribute -O2 -I. -I../include -D_GNU_SOURCE -I../cil/include -fPIC -c -o ../cil/src/cil_lexer.o ../cil/src/cil_lexer.c
<stdout>: In function ‘cil_yy_scan_bytes’:
<stdout>:1594:17: error: comparison between signed and unsigned integer expressions [-Werror=sign-compare]
cc1: all warnings being treated as errors

This occurs while compiling libsepol.

Comment 9 Stephen Smalley 2016-10-06 12:47:38 UTC
And this is on rawhide with flex-2.6.1-2.fc26.x86_64

Comment 10 Stephen Smalley 2016-10-06 12:53:37 UTC
Line 1594 of cil_lexer.c has this:
        for ( i = 0; i < _yybytes_len; ++i )
i is yy_size_t.
__yybytes_len is int.

Comment 11 Fedora End Of Life 2017-07-25 22:51:40 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. 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 '24'.

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 24 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 12 Fedora End Of Life 2017-08-08 17:06:32 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 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.