summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/flex/flex/avoid-FORTIFY-warnings.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/flex/flex/avoid-FORTIFY-warnings.patch')
-rw-r--r--meta/recipes-devtools/flex/flex/avoid-FORTIFY-warnings.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-devtools/flex/flex/avoid-FORTIFY-warnings.patch b/meta/recipes-devtools/flex/flex/avoid-FORTIFY-warnings.patch
new file mode 100644
index 0000000000..c71eb82792
--- /dev/null
+++ b/meta/recipes-devtools/flex/flex/avoid-FORTIFY-warnings.patch
@@ -0,0 +1,59 @@
1Wrap ECHO macro to avoid FORTIFY warnings
2
3This change will enable flex scanners to be compiled with
4-D_FORTIFY_SOURCE=2.
5
6Signed-off-by: Manoj Srivastava <srivasta@debian.org>
7Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
8
9Origin: Cherry picked from Debian
10Upstream-Status: Pending
11
12---
13 flex.skl | 2 +-
14 scan.c | 2 +-
15 skel.c | 2 +-
16 3 files changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/flex.skl b/flex.skl
19index 6ebf2fd..eaa355e 100644
20--- a/flex.skl
21+++ b/flex.skl
22@@ -1074,7 +1074,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
23 /* This used to be an fputs(), but since the string might contain NUL's,
24 * we now use fwrite().
25 */
26-#define ECHO fwrite( yytext, yyleng, 1, yyout )
27+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
28 %endif
29 %if-c++-only C++ definition
30 #define ECHO LexerOutput( yytext, yyleng )
31diff --git a/scan.c b/scan.c
32index d7f5db3..1a079bf 100644
33--- a/scan.c
34+++ b/scan.c
35@@ -2093,7 +2093,7 @@ static int input (void );
36 /* This used to be an fputs(), but since the string might contain NUL's,
37 * we now use fwrite().
38 */
39-#define ECHO fwrite( yytext, yyleng, 1, yyout )
40+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
41 #endif
42
43 /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
44diff --git a/skel.c b/skel.c
45index ee9f6ef..b8a2b4b 100644
46--- a/skel.c
47+++ b/skel.c
48@@ -1141,7 +1141,7 @@ const char *skel[] = {
49 "/* This used to be an fputs(), but since the string might contain NUL's,",
50 " * we now use fwrite().",
51 " */",
52- "#define ECHO fwrite( yytext, yyleng, 1, yyout )",
53+ "#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)",
54 "%endif",
55 "%if-c++-only C++ definition",
56 "#define ECHO LexerOutput( yytext, yyleng )",
57--
581.7.9.5
59