Bug 445950 - signed/unsigned comparison in the generated code.
Summary: signed/unsigned comparison in the generated code.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: flex
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Petr Machata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-05-10 08:39 UTC by Pawel Salek
Modified: 2015-05-05 01:33 UTC (History)
1 user (show)

Fixed In Version: 2.5.35-2.fc9
Clone Of:
Environment:
Last Closed: 2008-05-13 14:32:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Proposed patch. (498 bytes, patch)
2008-05-10 08:39 UTC, Pawel Salek
no flags Details | Diff

Description Pawel Salek 2008-05-10 08:39:15 UTC
Description of problem:
flex generates code that compares signed and unsigned numbers. While this is
unlikely to cause problems in practice, it's nice habit to declare the variable
types properly.

Version-Release number of selected component (if applicable):
flex-2.5.35-1.fc9

How reproducible:
Always.

Steps to Reproduce:
1. Use following code:
%option noyywrap

white		[ \t]+

%%
{white} 	{ /* We ignore white characters. */ }

2. Compile using flex flex_test.l && cc -Wsign-compare lex.yy.c

  
Actual results:
lex.yy.c: In function ‘yy_get_next_buffer’:
lex.yy.c:956: warning: comparison between signed and unsigned


Expected results:
Warningless compilation.

Additional info:
I have contacted flex maintainer (srivasta at debian) on 2008-04-30 but received
no response so far.

Comment 1 Pawel Salek 2008-05-10 08:39:15 UTC
Created attachment 305010 [details]
Proposed patch.

Comment 2 Fedora Update System 2008-05-12 14:02:20 UTC
flex-2.5.35-2.fc9 has been submitted as an update for Fedora 9

Comment 3 Fedora Update System 2008-05-13 14:32:23 UTC
flex-2.5.35-2.fc9 has been pushed to the Fedora 9 stable repository.  If problems still persist, please make note of it in this bug report.


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