[2.6 patch] powerpc/boot/dtc-src/dtc-lexer.l: add %option noinput

2008-07-17 Thread Adrian Bunk
gcc 4.3 correctly determines that input() is unused and gives the 
following warning:

--  snip  --

...
  HOSTCC  arch/powerpc/boot/dtc-src/dtc-lexer.lex.o
dtc-lexer.lex.c:1436: warning: ‘input’ defined but not used
...

--  snip  --

Fix it by adding %option noinput to 
arch/powerpc/boot/dtc-src/dtc-lexer.l and 
regeneration of arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

---

 arch/powerpc/boot/dtc-src/dtc-lexer.l |2 
 arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped |  127 +-
 2 files changed, 84 insertions(+), 45 deletions(-)

551cd080360b31cf9b8bb387916f3852e4fb6156 
diff --git a/arch/powerpc/boot/dtc-src/dtc-lexer.l 
b/arch/powerpc/boot/dtc-src/dtc-lexer.l
index c811b22..1f76fea 100644
--- a/arch/powerpc/boot/dtc-src/dtc-lexer.l
+++ b/arch/powerpc/boot/dtc-src/dtc-lexer.l
@@ -18,7 +18,7 @@
  *   USA
  */
 
-%option noyywrap nounput yylineno
+%option noyywrap nounput yylineno noinput
 
 %x INCLUDE
 %x BYTESTRING
diff --git a/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped 
b/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
index d0f7424..fa309bc 100644
--- a/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
+++ b/arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped
@@ -1,6 +1,6 @@
-#line 2 dtc-lexer.lex.c
+#line 2 arch/powerpc/boot/dtc-src/dtc-lexer.lex.c
 
-#line 4 dtc-lexer.lex.c
+#line 4 arch/powerpc/boot/dtc-src/dtc-lexer.lex.c
 
 #define  YY_INT_ALIGNED short int
 
@@ -9,7 +9,7 @@
 #define FLEX_SCANNER
 #define YY_FLEX_MAJOR_VERSION 2
 #define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 33
+#define YY_FLEX_SUBMINOR_VERSION 35
 #if YY_FLEX_SUBMINOR_VERSION  0
 #define FLEX_BETA
 #endif
@@ -31,7 +31,7 @@
 
 /* C99 systems have inttypes.h. Non-C99 systems may or may not. */
 
-#if __STDC_VERSION__ = 199901L
+#if defined (__STDC_VERSION__)  __STDC_VERSION__ = 199901L
 
 /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
  * if you want the limit (max/min) macros for int types. 
@@ -54,7 +54,6 @@ typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
-#endif /* ! C99 */
 
 /* Limits of integral types. */
 #ifndef INT8_MIN
@@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t;
 #define UINT32_MAX (4294967295U)
 #endif
 
+#endif /* ! C99 */
+
 #endif /* ! FLEXINT_H */
 
 #ifdef __cplusplus
@@ -94,11 +95,12 @@ typedef unsigned int flex_uint32_t;
 
 #else  /* ! __cplusplus */
 
-#if __STDC__
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
 
 #define YY_USE_CONST
 
-#endif /* __STDC__ */
+#endif /* defined (__STDC__) */
 #endif /* ! __cplusplus */
 
 #ifdef YY_USE_CONST
@@ -191,14 +193,9 @@ extern FILE *yyin, *yyout;
 
 #define unput(c) yyunput( c, (yytext_ptr)  )
 
-/* The following is because we cannot portably get our hands on size_t
- * (without autoconf's help, which isn't available because we want
- * flex-generated scanners to compile on their own).
- */
-
 #ifndef YY_TYPEDEF_YY_SIZE_T
 #define YY_TYPEDEF_YY_SIZE_T
-typedef unsigned int yy_size_t;
+typedef size_t yy_size_t;
 #endif
 
 #ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -349,7 +346,7 @@ void yyfree (void *  );
 
 /* Begin user sect3 */
 
-#define yywrap() 1
+#define yywrap(n) 1
 #define YY_SKIP_YYWRAP
 
 typedef unsigned char YY_CHAR;
@@ -576,7 +573,7 @@ int yy_flex_debug = 0;
 #define YY_MORE_ADJ 0
 #define YY_RESTORE_YY_MORE_OFFSET
 char *yytext;
-#line 1 dtc-lexer.l
+#line 1 arch/powerpc/boot/dtc-src/dtc-lexer.l
 /*
  * (C) Copyright David Gibson [EMAIL PROTECTED], IBM Corporation.  2005.
  *
@@ -596,11 +593,12 @@ char *yytext;
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *   USA
  */
+#define YY_NO_INPUT 1
 
 
 
 
-#line 33 dtc-lexer.l
+#line 33 arch/powerpc/boot/dtc-src/dtc-lexer.l
 #include dtc.h
 #include srcpos.h
 #include dtc-parser.tab.h
@@ -623,7 +621,7 @@ static int dts_version; /* = 0 */
DPRINT(V1\n); \
BEGIN(V1); \
}
-#line 627 dtc-lexer.lex.c
+#line 625 arch/powerpc/boot/dtc-src/dtc-lexer.lex.c
 
 #define INITIAL 0
 #define INCLUDE 1
@@ -645,6 +643,35 @@ static int dts_version; /* = 0 */
 
 static int yy_init_globals (void );
 
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (void );
+
+int yyget_debug (void );
+
+void yyset_debug (int debug_flag  );
+
+YY_EXTRA_TYPE yyget_extra (void );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined  );
+
+FILE *yyget_in (void );
+
+void yyset_in  (FILE * in_str  );
+
+FILE *yyget_out (void );
+
+void yyset_out  (FILE * out_str  );
+
+int yyget_leng (void );
+
+char *yyget_text (void );
+
+int yyget_lineno (void );
+
+void yyset_lineno (int 

Re: [2.6 patch] powerpc/boot/dtc-src/dtc-lexer.l: add %option noinput

2008-07-17 Thread David Gibson
On Thu, Jul 17, 2008 at 09:19:49PM +0300, Adrian Bunk wrote:
 gcc 4.3 correctly determines that input() is unused and gives the 
 following warning:
 
 --  snip  --
 
 ...
   HOSTCC  arch/powerpc/boot/dtc-src/dtc-lexer.lex.o
 dtc-lexer.lex.c:1436: warning: ‘input’ defined but not used
 ...
 
 --  snip  --
 
 Fix it by adding %option noinput to 
 arch/powerpc/boot/dtc-src/dtc-lexer.l and 
 regeneration of arch/powerpc/boot/dtc-src/dtc-lexer.lex.c_shipped.
 
 Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

Uh.. that should be fixed in dtc upstream.  It's probably time we
updated the in-kernel dtc from upstream anyway.

-- 
David Gibson| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
___
Linuxppc-dev mailing list
Linuxppc-dev@ozlabs.org
https://ozlabs.org/mailman/listinfo/linuxppc-dev