Mon Apr 20 2009 Petr Machata <pmachata@redhat.com> - 2.5.35-4
- Get rid of warning caused by ignoring return value of fwrite() in ECHO
    macro. Debian patch.
- Resolves: #484961
This commit is contained in:
Petr Machata 2009-04-20 11:26:12 +00:00
parent 63237cc23d
commit db7d0160b5
2 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,36 @@
diff -u flex-2.5.35/scan.c flex-2.5.35/scan.c
--- flex-2.5.35/scan.c
+++ flex-2.5.35/scan.c
@@ -2096,7 +2096,7 @@
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
diff -u flex-2.5.35/flex.skl flex-2.5.35/flex.skl
--- flex-2.5.35/flex.skl
+++ flex-2.5.35/flex.skl
@@ -1075,7 +1075,7 @@
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
%endif
%if-c++-only C++ definition
#define ECHO LexerOutput( yytext, yyleng )
diff -u flex-2.5.35/skel.c flex-2.5.35/skel.c
--- flex-2.5.35/skel.c
+++ flex-2.5.35/skel.c
@@ -1142,7 +1142,7 @@
"/* This used to be an fputs(), but since the string might contain NUL's,",
" * we now use fwrite().",
" */",
- "#define ECHO fwrite( yytext, yyleng, 1, yyout )",
+ "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)",
"%endif",
"%if-c++-only C++ definition",
"#define ECHO LexerOutput( yytext, yyleng )",

View File

@ -1,12 +1,14 @@
Summary: A tool for creating scanners (text pattern recognizers)
Name: flex
Version: 2.5.35
Release: 3%{?dist}
Release: 4%{?dist}
License: BSD
Group: Development/Tools
URL: http://flex.sourceforge.net/
Source: flex-%{version}.tar.bz2
Patch0: flex-2.5.35-sign.patch
Patch1: flex-2.5.35-hardening.patch
Patch2: flex-2.5.35-gcc44.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: m4
BuildRequires: gettext bison m4
@ -30,6 +32,8 @@ application development.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%build
%configure --disable-dependency-tracking CFLAGS="-fPIC $RPM_OPT_FLAGS"
@ -76,6 +80,14 @@ rm -rf ${RPM_BUILD_ROOT}
%{_infodir}/flex.info*
%changelog
* Mon Apr 20 2009 Debarshi Ray <rishi@fedoraproject.org> - 2.5.35-4
- Resolves: #496548.
* Mon Apr 20 2009 Petr Machata <pmachata@redhat.com> - 2.5.35-4
- Get rid of warning caused by ignoring return value of fwrite() in
ECHO macro. Debian patch.
- Resolves: #484961
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5.35-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild