Patchwork Add noyywrap to ada-lex.l

login
register
mail settings
Submitter Tom Tromey
Date May 3, 2019, 7:46 p.m.
Message ID <20190503194609.27403-1-tromey@adacore.com>
Download mbox | patch
Permalink /patch/32507/
State New
Headers show

Comments

Tom Tromey - May 3, 2019, 7:46 p.m.
From: Dilyan Palauzov <dilyan.palauzov@aegee.org>

This patch comes from PR ada/21406.  It adds the noyywrap option to
ada-lex.l.  This was already done (by the same author) for other .l
files in the binutils-gdb tree, so it seems reasonably safe.

Tested on x86-64 Fedora 29.

gdb/ChangeLog
2019-05-03  Dilyan Palauzov  <dilyan.palauzov@aegee.org>

	PR ada/21406:
	* ada-exp.y (yywrap): Don't define.
	* ada-lex.l (%option): Add noyywrap
	(yywrap): Remove.
---
 gdb/ChangeLog | 7 +++++++
 gdb/ada-exp.y | 1 -
 gdb/ada-lex.l | 8 +-------
 3 files changed, 8 insertions(+), 8 deletions(-)
Joel Brobecker - May 3, 2019, 9:40 p.m.
> From: Dilyan Palauzov <dilyan.palauzov@aegee.org>
> 
> This patch comes from PR ada/21406.  It adds the noyywrap option to
> ada-lex.l.  This was already done (by the same author) for other .l
> files in the binutils-gdb tree, so it seems reasonably safe.
> 
> Tested on x86-64 Fedora 29.
> 
> gdb/ChangeLog
> 2019-05-03  Dilyan Palauzov  <dilyan.palauzov@aegee.org>
> 
> 	PR ada/21406:
> 	* ada-exp.y (yywrap): Don't define.
> 	* ada-lex.l (%option): Add noyywrap
> 	(yywrap): Remove.

Thanks Tom. Looks like a nice and easy simplification. OK for me.

> ---
>  gdb/ChangeLog | 7 +++++++
>  gdb/ada-exp.y | 1 -
>  gdb/ada-lex.l | 8 +-------
>  3 files changed, 8 insertions(+), 8 deletions(-)
> 
> diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
> index efad85b19ad..eb71f124848 100644
> --- a/gdb/ada-exp.y
> +++ b/gdb/ada-exp.y
> @@ -717,7 +717,6 @@ primary	:	'*' primary		%prec '.'
>  #define yy_switch_to_buffer ada_yy_switch_to_buffer
>  #define yyrestart ada_yyrestart
>  #define yytext ada_yytext
> -#define yywrap ada_yywrap
>  
>  static struct obstack temp_parse_space;
>  
> diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
> index f7fac27410e..8ce7c3a99a9 100644
> --- a/gdb/ada-lex.l
> +++ b/gdb/ada-lex.l
> @@ -89,7 +89,7 @@ static int paren_depth;
>  
>  %}
>  
> -%option case-insensitive interactive nodefault
> +%option case-insensitive interactive nodefault noyywrap
>  
>  %s BEFORE_QUAL_QUOTE
>  
> @@ -634,12 +634,6 @@ rewind_to_char (int ch)
>    yyrestart (NULL);
>  }
>  
> -int
> -yywrap(void)
> -{
> -  return 1;
> -}
> -
>  /* Dummy definition to suppress warnings about unused static definitions. */
>  typedef void (*dummy_function) ();
>  dummy_function ada_flex_use[] = 
> -- 
> 2.20.1

Patch

diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
index efad85b19ad..eb71f124848 100644
--- a/gdb/ada-exp.y
+++ b/gdb/ada-exp.y
@@ -717,7 +717,6 @@  primary	:	'*' primary		%prec '.'
 #define yy_switch_to_buffer ada_yy_switch_to_buffer
 #define yyrestart ada_yyrestart
 #define yytext ada_yytext
-#define yywrap ada_yywrap
 
 static struct obstack temp_parse_space;
 
diff --git a/gdb/ada-lex.l b/gdb/ada-lex.l
index f7fac27410e..8ce7c3a99a9 100644
--- a/gdb/ada-lex.l
+++ b/gdb/ada-lex.l
@@ -89,7 +89,7 @@  static int paren_depth;
 
 %}
 
-%option case-insensitive interactive nodefault
+%option case-insensitive interactive nodefault noyywrap
 
 %s BEFORE_QUAL_QUOTE
 
@@ -634,12 +634,6 @@  rewind_to_char (int ch)
   yyrestart (NULL);
 }
 
-int
-yywrap(void)
-{
-  return 1;
-}
-
 /* Dummy definition to suppress warnings about unused static definitions. */
 typedef void (*dummy_function) ();
 dummy_function ada_flex_use[] =