| Summary: | [patch] flex(1) generated files fail to compile cleanly with -Wconversion | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | avn <avn> | ||||
| Component: | bin | Assignee: | Jung-uk Kim <jkim> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 4.3-STABLE | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
Hello Alexey! Could you please try to coordinate the acceptance of your patch with the Flex maintainers? (See lex/README.) This way, we could import your fix as a vendor fix onto the LBL branch. Thanks, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age I suspect this bug has already been fixed in newer releases of flex: I know I've come across similar bugs in 2.5.4 which are fixed even in 2.5.33 (the newest being 2.5.35). Is there any chance that a newer version could be imported into FreeBSD? -- Bruce Cran Responsible Changed From-To: freebsd-bugs->bapt please don't hate me Responsible Changed From-To: bapt->jkim Over to new flex maintainer State Changed
From-To: open->closed
It is very easy to fix for WARNS=6, aka "BDECFLAGS".
--- a.l
+++ a.l
@@ -1,4 +1,4 @@
-%option noyywrap
+%option noyywrap noinput nounput
%{
#include <stdio.h>
%}
|
lex(1) generates files which do not pass -Wconversion either with -ansi or without it. This means, they won't compile under BDECFLAGS. Fix: The patch below makes this sample to go cleanly under -Wconversion with or without -ansi. How-To-Repeat: --- Makefile --- SRCS = a.l PROG = a NOMAN = yes NOOBJ = yes CFLAGS = -Wconversion -ansi -pedantic .include <bsd.prog.mk> --- a.l --- %option noyywrap %{ #include <stdio.h> %} %% . { } %% int main(void) { return 0; } --- end --- produce the following warnings: a.l: In function `yylex': a.l:7: warning: passing arg 2 of `fwrite' as unsigned due to prototype a.l: In function `yy_get_next_buffer': a.l:246: warning: passing arg 3 of `fread' as unsigned due to prototype Also, these warnings point to 'a.l' which is erroneous (obviously, a.l does not have line 246 :).